More rename substitutions

This commit is contained in:
Vincent Lee committed 2016-03-18 11:07:42 -05:00
1 parent 5821ede5e6
commit 3bb203e371
44 files changed
+116 -90

No files matched your search

@@ -52,7 +52,7 @@ public final class DebugHandler {
Entity ent = Minecraft.getMinecraft().getIntegratedServer().getEntityFromUuid(id);
if (ent != null) {
World serverWorld = Minecraft.getMinecraft().getIntegratedServer().getEntityFromUuid(id).worldObj;
event.left.add(PREFIX + String.format("(INTEGRATED SERVER DIM %d) netColl : %d, netPool: %d", serverWorld.provider.getDimensionId(), ManaNetworkHandler.instance.getAllCollectorsInWorld(serverWorld).size(), ManaNetworkHandler.instance.getAllPoolsInWorld(serverWorld).size()));
event.left.add(PREFIX + String.format("(INTEGRATED SERVER DIM %d) netColl : %d, netPool: %d", serverWorld.provider.getDimension(), ManaNetworkHandler.instance.getAllCollectorsInWorld(serverWorld).size(), ManaNetworkHandler.instance.getAllPoolsInWorld(serverWorld).size()));
}
}
@@ -101,8 +101,8 @@ public final class HUDHandler {
RayTraceResult pos = mc.objectMouseOver;
if(pos != null) {
Block block = pos.typeOfHit == RayTraceResult.MovingObjectType.BLOCK ? mc.theWorld.getBlockState(pos.getBlockPos()).getBlock() : null;
TileEntity tile = pos.typeOfHit == RayTraceResult.MovingObjectType.BLOCK ? mc.theWorld.getTileEntity(pos.getBlockPos()) : null;
Block block = pos.typeOfHit == RayTraceResult.Type.BLOCK ? mc.theWorld.getBlockState(pos.getBlockPos()).getBlock() : null;
TileEntity tile = pos.typeOfHit == RayTraceResult.Type.BLOCK ? mc.theWorld.getTileEntity(pos.getBlockPos()) : null;
if(equippedStack != null) {
if(pos != null && equippedStack.getItem() == ModItems.twigWand) {
@@ -420,7 +420,7 @@ public class LightningHandler {
if(mop == null)
return prevresistance;
if(mop.typeOfHit == RayTraceResult.MovingObjectType.BLOCK) {
if(mop.typeOfHit == RayTraceResult.Type.BLOCK) {
Block block = world.getBlockState(mop.getBlockPos()).getBlock();
if(world.isAirBlock(mop.getBlockPos()))
@@ -19,6 +19,11 @@ import net.minecraft.client.renderer.block.model.IBakedModel;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.util.*;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.RayTraceResult;
import net.minecraft.util.text.Style;
import net.minecraft.util.text.TextComponentTranslation;
import net.minecraft.util.text.TextFormatting;
import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World;
import net.minecraftforge.client.event.RenderWorldLastEvent;
@@ -87,7 +92,7 @@ public final class MultiblockRenderHandler {
Minecraft mc = Minecraft.getMinecraft();
if(mc.theWorld != null)
dimension = mc.theWorld.provider.getDimensionId();
dimension = mc.theWorld.provider.getDimension();
}
@SubscribeEvent
@@ -109,7 +114,7 @@ public final class MultiblockRenderHandler {
}
private void renderPlayerLook(EntityPlayer player, RayTraceResult src) {
if(currentMultiblock != null && dimension == player.worldObj.provider.getDimensionId()) {
if(currentMultiblock != null && dimension == player.worldObj.provider.getDimension()) {
BlockPos anchorPos = anchor != null ? anchor : src.getBlockPos();
GlStateManager.pushMatrix();
@@ -132,7 +137,7 @@ public final class MultiblockRenderHandler {
if(!didAny) {
setMultiblock(null);
player.addChatComponentMessage(new TextComponentTranslation("botaniamisc.structureComplete").setChatStyle(new ChatStyle().setColor(TextFormatting.GREEN)));
player.addChatComponentMessage(new TextComponentTranslation("botaniamisc.structureComplete").setChatStyle(new Style().setColor(TextFormatting.GREEN)));
}
}
}
@@ -20,7 +20,7 @@ import net.minecraft.client.gui.GuiButton;
import net.minecraft.client.gui.GuiScreen;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.util.text.TextComponentTranslation;
import net.minecraft.util.ChatStyle;
import net.minecraft.util.text.Style;
import net.minecraft.util.text.TextFormatting;
import net.minecraft.util.text.translation.I18n;
@@ -214,7 +214,7 @@ public class GuiLexiconEntry extends GuiLexicon implements IGuiLexiconEntry, IPa
tutorial.poll();
positionTutorialArrow();
if(tutorial.isEmpty()) {
mc.thePlayer.addChatMessage(new TextComponentTranslation("botaniamisc.tutorialEnded").setChatStyle(new ChatStyle().setColor(TextFormatting.RED)));
mc.thePlayer.addChatMessage(new TextComponentTranslation("botaniamisc.tutorialEnded").setChatStyle(new Style().setColor(TextFormatting.RED)));
hasTutorialArrow = false;
}
}
@@ -8,7 +8,7 @@ import java.util.List;
import net.minecraft.client.Minecraft;
import net.minecraft.client.renderer.GlStateManager;
import net.minecraft.client.renderer.Tessellator;
import net.minecraft.client.renderer.entity.RenderItem;
import net.minecraft.client.renderer.RenderItem;
import net.minecraft.client.renderer.texture.TextureAtlasSprite;
import net.minecraft.client.renderer.texture.TextureMap;
import net.minecraft.entity.player.EntityPlayer;
@@ -9,7 +9,7 @@
package vazkii.botania.client.render.entity;
import com.google.common.base.Function;
import net.minecraft.client.renderer.entity.RenderItem;
import net.minecraft.client.renderer.RenderItem;
import net.minecraft.client.renderer.entity.RenderManager;
import net.minecraft.client.renderer.entity.RenderSnowball;
import net.minecraft.entity.Entity;
@@ -27,7 +27,7 @@ public class RenderSnowballStack<T extends Entity> extends RenderSnowball<T> {
}
@Override
public ItemStack func_177082_d(T entity) {
public ItemStack getPotion(T entity) {
return stackGetter.apply(entity);
}
@@ -22,7 +22,7 @@ public final class SkyblockRenderEvents {
@SubscribeEvent
public void onRender(RenderWorldLastEvent event) {
World world = Minecraft.getMinecraft().theWorld;
if(ConfigHandler.enableFancySkybox && world.provider.getDimensionId() == 0 && (ConfigHandler.enableFancySkyboxInNormalWorlds || WorldTypeSkyblock.isWorldSkyblock(Minecraft.getMinecraft().theWorld))) {
if(ConfigHandler.enableFancySkybox && world.provider.getDimension() == 0 && (ConfigHandler.enableFancySkyboxInNormalWorlds || WorldTypeSkyblock.isWorldSkyblock(Minecraft.getMinecraft().theWorld))) {
if(!(world.provider.getSkyRenderer() instanceof SkyblockSkyRenderer))
world.provider.setSkyRenderer(new SkyblockSkyRenderer());
}
@@ -15,7 +15,7 @@ import net.minecraft.event.ClickEvent;
import net.minecraft.event.HoverEvent;
import net.minecraft.util.text.TextComponentString;
import net.minecraft.util.text.TextComponentTranslation;
import net.minecraft.util.ChatStyle;
import net.minecraft.util.text.Style;
import net.minecraft.util.text.TextFormatting;
import net.minecraft.util.text.ITextComponent;
import net.minecraftforge.common.MinecraftForge;
@@ -87,14 +87,14 @@ public class Botania {
EntityPlayer player = evt.player;
ITextComponent message = new TextComponentTranslation("botaniamisc.unofficial.nag");
message.setChatStyle(new ChatStyle().setColor(TextFormatting.RED));
message.setChatStyle(new Style().setColor(TextFormatting.RED));
ITextComponent message2 = new TextComponentTranslation("botaniamisc.unofficial.report");
message2.setChatStyle(new ChatStyle().setColor(TextFormatting.YELLOW));
message2.setChatStyle(new Style().setColor(TextFormatting.YELLOW));
ITextComponent url = new TextComponentString("https://github.com/williewillus/Botania/issues");
url.getChatStyle().setChatClickEvent(new ClickEvent(ClickEvent.Action.OPEN_URL, "https://github.com/williewillus/Botania/issues"));
url.getChatStyle().setChatHoverEvent(new HoverEvent(HoverEvent.Action.SHOW_TEXT, new TextComponentString("CLICK")));
url.getStyle().setChatClickEvent(new ClickEvent(ClickEvent.Action.OPEN_URL, "https://github.com/williewillus/Botania/issues"));
url.getStyle().setChatHoverEvent(new HoverEvent(HoverEvent.Action.SHOW_TEXT, new TextComponentString("CLICK")));
player.addChatComponentMessage(message);
@@ -24,6 +24,8 @@ import net.minecraft.init.Blocks;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.util.*;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.RayTraceResult;
import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World;
import net.minecraftforge.common.EnumPlantType;
@@ -79,7 +79,7 @@ public class BlockPistonRelay extends BlockMod implements IWandable, ILexiconabl
@Override
public void breakBlock(World par1World, BlockPos pos, IBlockState state) {
mapCoords(par1World.provider.getDimensionId(), pos, 2);
mapCoords(par1World.provider.getDimension(), pos, 2);
}
static void mapCoords(int world, BlockPos pos, int time) {
@@ -116,7 +116,7 @@ public class BlockPistonRelay extends BlockMod implements IWandable, ILexiconabl
return false;
if(!player.isSneaking()) {
playerPositions.put(player.getName(), new DimWithPos(world.provider.getDimensionId(), pos));
playerPositions.put(player.getName(), new DimWithPos(world.provider.getDimension(), pos));
world.playSoundEffect(pos.getX(), pos.getY(), pos.getZ(), "botania:ding", 0.5F, 1F);
} else {
spawnAsEntity(world, pos, new ItemStack(this));
@@ -212,7 +212,7 @@ public class BlockPistonRelay extends BlockMod implements IWandable, ILexiconabl
world.spawnEntityInWorld(new EntityItem(world, x + dir.getFrontOffsetX(), y + dir.getFrontOffsetY(), z + dir.getFrontOffsetZ(), stack));
}
checkedCoords.add(s);
newPos = new DimWithPos(world.provider.getDimensionId(), pos.offset(dir));
newPos = new DimWithPos(world.provider.getDimension(), pos.offset(dir));
}
if(mappedPositions.containsKey(s)) {
@@ -230,7 +230,7 @@ public class BlockPistonRelay extends BlockMod implements IWandable, ILexiconabl
if(world.isAirBlock(pos2.offset(dir)) || destMat.isReplaceable()) {
world.setBlockState(pos2, Blocks.air.getDefaultState());
world.setBlockState(pos2.offset(dir), srcState, 1 | 2);
mappedPositions.put(s, new DimWithPos(world.provider.getDimensionId(), pos2.offset(dir)));
mappedPositions.put(s, new DimWithPos(world.provider.getDimension(), pos2.offset(dir)));
}
}
@@ -31,7 +31,7 @@ public class SubTileFallenKanade extends SubTileFunctional {
final int cost = 120;
if(!supertile.getWorld().isRemote && supertile.getWorld().provider.getDimensionId() != 1) {
if(!supertile.getWorld().isRemote && supertile.getWorld().provider.getDimension() != 1) {
List<EntityPlayer> players = supertile.getWorld().getEntitiesWithinAABB(EntityPlayer.class, new AxisAlignedBB(supertile.getPos().add(-RANGE, -RANGE, -RANGE), supertile.getPos().add(RANGE + 1, RANGE + 1, RANGE + 1)));
for(EntityPlayer player : players) {
if(player.getActivePotionEffect(Potion.regeneration) == null && mana >= cost ) {
@@ -24,7 +24,7 @@ import net.minecraft.init.Blocks;
import net.minecraft.item.Item;
import net.minecraft.item.ItemBlock;
import net.minecraft.item.ItemRedstone;
import net.minecraft.item.ItemReed;
import net.minecraft.item.ItemBlockSpecial;
import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.math.AxisAlignedBB;
@@ -92,7 +92,7 @@ public class SubTileRannuncarpus extends SubTileFunctional {
ItemStack stack = item.getEntityItem();
Item stackItem = stack.getItem();
if(stackItem instanceof ItemBlock || stackItem instanceof ItemReed || stackItem instanceof ItemRedstone || stackItem instanceof IFlowerPlaceable) {
if(stackItem instanceof ItemBlock || stackItem instanceof ItemBlockSpecial || stackItem instanceof ItemRedstone || stackItem instanceof IFlowerPlaceable) {
if(!scanned) {
for(int i = -rangePlace; i < rangePlace + 1; i++)
for(int j = -rangePlaceY; j < rangePlaceY + 1; j++)
@@ -116,8 +116,8 @@ public class SubTileRannuncarpus extends SubTileFunctional {
blockToPlace = ((IFlowerPlaceable) stackItem).getBlockToPlaceByFlower(stack, this, coords);
if(stackItem instanceof ItemBlock)
blockToPlace = ((ItemBlock) stackItem).block;
else if(stackItem instanceof ItemReed)
blockToPlace = ReflectionHelper.getPrivateValue(ItemReed.class, (ItemReed) stackItem, LibObfuscation.REED_ITEM);
else if(stackItem instanceof ItemBlockSpecial)
blockToPlace = ReflectionHelper.getPrivateValue(ItemBlockSpecial.class, (ItemBlockSpecial) stackItem, LibObfuscation.REED_ITEM);
else if(stackItem instanceof ItemRedstone)
blockToPlace = Blocks.redstone_wire;
@@ -26,7 +26,7 @@ import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.util.math.AxisAlignedBB;
import net.minecraft.util.text.TextComponentTranslation;
import net.minecraft.util.ChatStyle;
import net.minecraft.util.text.Style;
import net.minecraft.util.text.TextFormatting;
import net.minecraftforge.event.ServerChatEvent;
@@ -209,7 +209,7 @@ public class TileCorporeaIndex extends TileCorporeaBase implements ICorporeaRequ
}
public static boolean isInRangeOfIndex(EntityPlayer player, TileCorporeaIndex index) {
return player.worldObj.provider.getDimensionId() == index.worldObj.provider.getDimensionId() && MathHelper.pointDistancePlane(index.getPos().getX() + 0.5, index.getPos().getZ() + 0.5, player.posX, player.posZ) < RADIUS && Math.abs(index.getPos().getY() + 0.5 - player.posY + (player.worldObj.isRemote ? 0 : 1.6)) < 5;
return player.worldObj.provider.getDimension() == index.worldObj.provider.getDimension() && MathHelper.pointDistancePlane(index.getPos().getX() + 0.5, index.getPos().getZ() + 0.5, player.posX, player.posZ) < RADIUS && Math.abs(index.getPos().getY() + 0.5 - player.posY + (player.worldObj.isRemote ? 0 : 1.6)) < 5;
}
public static void addPattern(String pattern, IRegexStacker stacker) {
@@ -268,7 +268,7 @@ public class TileCorporeaIndex extends TileCorporeaBase implements ICorporeaRequ
index.doCorporeaRequest(name, count, spark);
event.player.addChatMessage(new TextComponentTranslation("botaniamisc.requestMsg", count, WordUtils.capitalizeFully(name), CorporeaHelper.lastRequestMatches, CorporeaHelper.lastRequestExtractions).setChatStyle(new ChatStyle().setColor(TextFormatting.LIGHT_PURPLE)));
event.player.addChatMessage(new TextComponentTranslation("botaniamisc.requestMsg", count, WordUtils.capitalizeFully(name), CorporeaHelper.lastRequestMatches, CorporeaHelper.lastRequestExtractions).setChatStyle(new Style().setColor(TextFormatting.LIGHT_PURPLE)));
if(CorporeaHelper.lastRequestExtractions >= 50000)
event.player.addStat(ModAchievements.superCorporeaRequest, 1);
}
@@ -12,8 +12,9 @@ package vazkii.botania.common.core.command;
import net.minecraft.command.CommandBase;
import net.minecraft.command.ICommandSender;
import net.minecraft.server.MinecraftServer;
import net.minecraft.util.text.TextComponentTranslation;
import net.minecraft.util.ChatStyle;
import net.minecraft.util.text.Style;
import net.minecraft.util.text.TextFormatting;
import vazkii.botania.common.core.version.ThreadDownloadMod;
import vazkii.botania.common.core.version.VersionChecker;
@@ -33,15 +34,15 @@ public class CommandDownloadLatest extends CommandBase {
}
@Override
public void processCommand(ICommandSender var1, String[] var2) {
public void execute(MinecraftServer server, ICommandSender var1, String[] var2) {
if(!ENABLED)
var1.addChatMessage(new TextComponentTranslation("botania.versioning.disabled").setChatStyle(new ChatStyle().setColor(TextFormatting.RED)));
var1.addChatMessage(new TextComponentTranslation("botania.versioning.disabled").setChatStyle(new Style().setColor(TextFormatting.RED)));
else if(var2.length == 1)
if(VersionChecker.downloadedFile)
var1.addChatMessage(new TextComponentTranslation("botania.versioning.downloadedAlready").setChatStyle(new ChatStyle().setColor(TextFormatting.RED)));
var1.addChatMessage(new TextComponentTranslation("botania.versioning.downloadedAlready").setChatStyle(new Style().setColor(TextFormatting.RED)));
else if(VersionChecker.startedDownload)
var1.addChatMessage(new TextComponentTranslation("botania.versioning.downloadingAlready").setChatStyle(new ChatStyle().setColor(TextFormatting.RED)));
var1.addChatMessage(new TextComponentTranslation("botania.versioning.downloadingAlready").setChatStyle(new Style().setColor(TextFormatting.RED)));
else new ThreadDownloadMod("Botania " + var2[0] + ".jar");
}
@@ -14,8 +14,10 @@ import net.minecraft.command.CommandBase;
import net.minecraft.command.ICommandSender;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.server.MinecraftServer;
import net.minecraft.util.text.Style;
import net.minecraft.util.text.TextComponentTranslation;
import net.minecraft.util.ChatStyle;
import net.minecraft.util.text.Style;
import net.minecraft.util.text.TextFormatting;
import vazkii.botania.common.item.ItemLexicon;
@@ -32,14 +34,14 @@ public class CommandOpen extends CommandBase {
}
@Override
public void processCommand(ICommandSender sender, String[] args) {
public void execute(MinecraftServer server, ICommandSender sender, String[] args) {
if(sender instanceof EntityPlayer) {
EntityPlayer player = (EntityPlayer) sender;
ItemStack stack = player.getCurrentEquippedItem();
if(stack != null && stack.getItem() instanceof ItemLexicon) {
ItemLexicon.setForcedPage(stack, args[0]);
ItemLexicon.setQueueTicks(stack, 5);
} else sender.addChatMessage(new TextComponentTranslation("botaniamisc.noLexicon").setChatStyle(new ChatStyle().setColor(TextFormatting.RED)));
} else sender.addChatMessage(new TextComponentTranslation("botaniamisc.noLexicon").setChatStyle(new Style().setColor(TextFormatting.RED)));
}
}
@@ -50,8 +52,8 @@ public class CommandOpen extends CommandBase {
}
@Override
public boolean canCommandSenderUseCommand(ICommandSender p_71519_1_) {
return p_71519_1_ instanceof EntityPlayer;
public boolean checkPermission(MinecraftServer server, ICommandSender sender) {
return sender instanceof EntityPlayer;
}
}
@@ -30,14 +30,14 @@ public class CommandShare extends CommandBase {
}
@Override
public void processCommand(ICommandSender sender, String[] args) {
public void execute(MinecraftServer server, ICommandSender sender, String[] args) {
String json = I18n.translateToLocal("botaniamisc.shareMsg");
json = json.replaceAll("%name%", sender.getName());
json = json.replaceAll("%entry%", args[0]);
json = json.replaceAll("%entryname%", I18n.translateToLocal(args[0]));
ITextComponent component = ITextComponent.Serializer.jsonToComponent(json);
MinecraftServer.getServer().getConfigurationManager().sendChatMsg(component);
server.getPlayerList().sendChatMsg(component);
}
@@ -47,7 +47,7 @@ public class CommandShare extends CommandBase {
}
@Override
public boolean canCommandSenderUseCommand(ICommandSender p_71519_1_) {
return p_71519_1_ instanceof EntityPlayer;
public boolean checkPermission(MinecraftServer server, ICommandSender sender) {
return sender instanceof EntityPlayer;
}
}
@@ -14,6 +14,7 @@ import net.minecraft.command.CommandBase;
import net.minecraft.command.CommandException;
import net.minecraft.command.ICommandSender;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.server.MinecraftServer;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.text.translation.I18n;
import vazkii.botania.common.core.helper.MathHelper;
@@ -37,7 +38,7 @@ public class CommandSkyblockSpread extends CommandBase {
}
@Override
public void processCommand(ICommandSender sender, String[] args) throws CommandException {
public void execute(MinecraftServer server, ICommandSender sender, String[] args) throws CommandException {
int maxAllowed = 1000000;
int minAllowed = 250;
int minDist = 100;
@@ -51,7 +52,7 @@ public class CommandSkyblockSpread extends CommandBase {
if(maxrange < minAllowed)
throw new CommandException(I18n.translateToLocal("botaniamisc.skyblockRangeTooLow"));
EntityPlayer player = getPlayer(sender, args[0]);
EntityPlayer player = getPlayer(server, sender, args[0]);
if(player != null) {
BlockPos spawn = player.worldObj.getSpawnPoint();
int x, z;
@@ -19,7 +19,7 @@ import java.util.Map;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.util.text.TextComponentString;
import net.minecraft.util.text.TextComponentTranslation;
import net.minecraft.util.ChatStyle;
import net.minecraft.util.text.Style;
import net.minecraft.util.text.TextFormatting;
import net.minecraftforge.common.MinecraftForge;
import net.minecraftforge.common.config.Configuration;
@@ -395,9 +395,9 @@ public final class ConfigHandler {
if(changes.size() == 0)
return;
player.addChatComponentMessage(new TextComponentTranslation("botaniamisc.adaptativeConfigChanges").setChatStyle(new ChatStyle().setColor(TextFormatting.GOLD)));
player.addChatComponentMessage(new TextComponentTranslation("botaniamisc.adaptativeConfigChanges").setChatStyle(new Style().setColor(TextFormatting.GOLD)));
for(String change : changes)
player.addChatMessage(new TextComponentString(change).setChatStyle(new ChatStyle().setColor(TextFormatting.LIGHT_PURPLE)));
player.addChatMessage(new TextComponentString(change).setChatStyle(new Style().setColor(TextFormatting.LIGHT_PURPLE)));
}
public void addMappingInt(int version, String key, int val) {
@@ -19,7 +19,7 @@ import java.net.URL;
import net.minecraft.client.Minecraft;
import net.minecraft.util.text.TextComponentTranslation;
import net.minecraft.util.ChatStyle;
import net.minecraft.util.text.Style;
import net.minecraft.util.text.TextFormatting;
import net.minecraft.util.text.ITextComponent;
import net.minecraft.util.text.translation.I18n;
@@ -82,7 +82,7 @@ public class ThreadDownloadMod extends Thread {
f.renameTo(f1);
if(Minecraft.getMinecraft().thePlayer != null)
Minecraft.getMinecraft().thePlayer.addChatMessage(new TextComponentTranslation("botania.versioning.doneDownloading", fileName).setChatStyle(new ChatStyle().setColor(TextFormatting.GREEN)));
Minecraft.getMinecraft().thePlayer.addChatMessage(new TextComponentTranslation("botania.versioning.doneDownloading", fileName).setChatStyle(new Style().setColor(TextFormatting.GREEN)));
Desktop.getDesktop().open(dir);
VersionChecker.downloadedFile = true;
@@ -101,6 +101,6 @@ public class ThreadDownloadMod extends Thread {
private void sendError() {
if(Minecraft.getMinecraft().thePlayer != null)
Minecraft.getMinecraft().thePlayer.addChatComponentMessage(new TextComponentTranslation("botania.versioning.error").setChatStyle(new ChatStyle().setColor(TextFormatting.RED)));
Minecraft.getMinecraft().thePlayer.addChatComponentMessage(new TextComponentTranslation("botania.versioning.error").setChatStyle(new Style().setColor(TextFormatting.RED)));
}
}
@@ -13,7 +13,7 @@ package vazkii.botania.common.core.version;
import net.minecraft.client.Minecraft;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.util.text.TextComponentTranslation;
import net.minecraft.util.ChatStyle;
import net.minecraft.util.text.Style;
import net.minecraft.util.text.TextFormatting;
import net.minecraft.util.text.ITextComponent;
import net.minecraft.util.text.translation.I18n;
@@ -47,7 +47,7 @@ public final class VersionChecker {
int onlineBuild = Integer.parseInt(onlineVersion.split("-")[1]);
int clientBuild = LibMisc.BUILD.contains("GRADLE") ? Integer.MIN_VALUE : Integer.parseInt(LibMisc.BUILD);
if(onlineBuild > clientBuild) {
player.addChatComponentMessage(new TextComponentTranslation("botania.versioning.flavour" + player.worldObj.rand.nextInt(FLAVOUR_MESSAGES)).setChatStyle(new ChatStyle().setColor(TextFormatting.LIGHT_PURPLE)));
player.addChatComponentMessage(new TextComponentTranslation("botania.versioning.flavour" + player.worldObj.rand.nextInt(FLAVOUR_MESSAGES)).setChatStyle(new Style().setColor(TextFormatting.LIGHT_PURPLE)));
player.addChatComponentMessage(new TextComponentTranslation("botania.versioning.outdated", clientBuild, onlineBuild));
ITextComponent component = ITextComponent.Serializer.jsonToComponent(I18n.translateToLocal("botania.versioning.updateMessage").replaceAll("%version%", onlineVersion));
@@ -47,7 +47,11 @@ import net.minecraft.potion.Potion;
import net.minecraft.potion.PotionEffect;
import net.minecraft.tileentity.TileEntityBeacon;
import net.minecraft.util.*;
import net.minecraft.util.math.AxisAlignedBB;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.MathHelper;
import net.minecraft.util.text.Style;
import net.minecraft.util.text.TextComponentTranslation;
import net.minecraft.util.text.TextFormatting;
import net.minecraft.world.EnumDifficulty;
import net.minecraft.world.World;
@@ -145,7 +149,7 @@ public class EntityDoppleganger extends EntityCreature implements IBotaniaBossWi
if(par3World.getTileEntity(pos) instanceof TileEntityBeacon && isTruePlayer(player)) {
if(par3World.getDifficulty() == EnumDifficulty.PEACEFUL) {
if(!par3World.isRemote)
player.addChatMessage(new TextComponentTranslation("botaniamisc.peacefulNoob").setChatStyle(new ChatStyle().setColor(TextFormatting.RED)));
player.addChatMessage(new TextComponentTranslation("botaniamisc.peacefulNoob").setChatStyle(new Style().setColor(TextFormatting.RED)));
return false;
}
@@ -156,7 +160,7 @@ public class EntityDoppleganger extends EntityCreature implements IBotaniaBossWi
Block blockat = state.getBlock();
if(blockat != ModBlocks.pylon || state.getValue(BotaniaStateProps.PYLON_VARIANT) != PylonVariant.GAIA) {
if(!par3World.isRemote)
player.addChatMessage(new TextComponentTranslation("botaniamisc.needsCatalysts").setChatStyle(new ChatStyle().setColor(TextFormatting.RED)));
player.addChatMessage(new TextComponentTranslation("botaniamisc.needsCatalysts").setChatStyle(new Style().setColor(TextFormatting.RED)));
return false;
}
}
@@ -175,7 +179,7 @@ public class EntityDoppleganger extends EntityCreature implements IBotaniaBossWi
}
if(!par3World.isRemote)
player.addChatMessage(new TextComponentTranslation("botaniamisc.badArena").setChatStyle(new ChatStyle().setColor(TextFormatting.RED)));
player.addChatMessage(new TextComponentTranslation("botaniamisc.badArena").setChatStyle(new Style().setColor(TextFormatting.RED)));
return false;
}
@@ -10,7 +10,7 @@
*/
package vazkii.botania.common.entity;
import net.minecraft.entity.ai.EntityAIArrowAttack;
import net.minecraft.entity.ai.EntityAIAttackRanged;
import net.minecraft.entity.ai.EntityAIHurtByTarget;
import net.minecraft.entity.ai.EntityAINearestAttackableTarget;
import net.minecraft.entity.ai.EntityAITasks;
@@ -30,7 +30,7 @@ public class EntityPinkWither extends EntityWither {
Iterator<EntityAITasks.EntityAITaskEntry> taskIter = this.tasks.taskEntries.iterator();
while (taskIter.hasNext()) {
EntityAITasks.EntityAITaskEntry entry = taskIter.next();
if (entry.action instanceof EntityAIArrowAttack) {
if (entry.action instanceof EntityAIAttackRanged) {
taskIter.remove(); // Remove firing wither skulls
}
}
@@ -60,8 +60,8 @@ public class EntityPoolMinecart extends EntityMinecart {
}
@Override
public EnumMinecartType getMinecartType() {
return EnumMinecartType.RIDEABLE;
public EntityMinecart.Type getType() {
return Type.RIDEABLE;
}
@Override
@@ -21,6 +21,7 @@ import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.init.Blocks;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.util.*;
import net.minecraft.util.math.RayTraceResult;
import net.minecraft.world.World;
import net.minecraft.world.WorldServer;
import net.minecraftforge.fml.relauncher.Side;
@@ -238,7 +239,7 @@ public abstract class EntityThrowableCopy extends Entity implements IProjectile
if (RayTraceResult != null)
{
if (RayTraceResult.typeOfHit == RayTraceResult.MovingObjectType.BLOCK && this.worldObj.getBlockState(RayTraceResult.getBlockPos()).getBlock() == Blocks.portal)
if (RayTraceResult.typeOfHit == RayTraceResult.Type.BLOCK && this.worldObj.getBlockState(RayTraceResult.getBlockPos()).getBlock() == Blocks.portal)
{
this.setPortal(RayTraceResult.getBlockPos());
}
@@ -101,7 +101,7 @@ public class EntityThrownItem extends EntityItem {
if (RayTraceResult != null)
{
if (RayTraceResult.typeOfHit == RayTraceResult.MovingObjectType.BLOCK && worldObj.getBlockState(RayTraceResult.getBlockPos()).getBlock() == Blocks.portal)
if (RayTraceResult.typeOfHit == RayTraceResult.Type.BLOCK && worldObj.getBlockState(RayTraceResult.getBlockPos()).getBlock() == Blocks.portal)
{
setPortal(RayTraceResult.getBlockPos());
}
@@ -161,7 +161,7 @@ public class ItemGrassSeeds extends ItemMod implements IFloatingFlowerVariant {
return;
if(event.phase == Phase.END) {
int dim = event.world.provider.getDimensionId();
int dim = event.world.provider.getDimension();
if(blockSwappers.containsKey(dim)) {
Set<BlockSwapper> swappers = blockSwappers.get(dim);
@@ -197,7 +197,7 @@ public class ItemGrassSeeds extends ItemMod implements IFloatingFlowerVariant {
return swapper;
// If a set for the dimension doesn't exist, create it.
int dim = world.provider.getDimensionId();
int dim = world.provider.getDimension();
if(!blockSwappers.containsKey(dim))
blockSwappers.put(dim, new HashSet<>());
@@ -24,6 +24,9 @@ import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.*;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.RayTraceResult;
import net.minecraft.util.text.translation.I18n;
import net.minecraft.world.World;
import net.minecraftforge.fml.common.registry.GameData;
import vazkii.botania.api.internal.IManaBurst;
@@ -133,7 +133,7 @@ public class ItemLexicon extends ItemMod implements ILexicon, IElvenItem {
LexiconEntry entry = getEntryFromForce(par1ItemStack);
if(entry != null)
Botania.proxy.setEntryToOpen(entry);
else par3EntityPlayer.addChatMessage(new TextComponentTranslation("botaniamisc.cantOpen").setChatStyle(new ChatStyle().setColor(TextFormatting.RED)));
else par3EntityPlayer.addChatMessage(new TextComponentTranslation("botaniamisc.cantOpen").setChatStyle(new Style().setColor(TextFormatting.RED)));
setForcedPage(par1ItemStack, "");
}
@@ -142,7 +142,7 @@ public class ItemManaMirror extends ItemMod implements IManaItem, ICoordBoundIte
ItemNBTHelper.setInt(stack, TAG_POS_X, pool == null ? 0 : pool.getPos().getX());
ItemNBTHelper.setInt(stack, TAG_POS_Y, pool == null ? -1 : pool.getPos().getY());
ItemNBTHelper.setInt(stack, TAG_POS_Z, pool == null ? 0 : pool.getPos().getZ());
ItemNBTHelper.setInt(stack, TAG_DIM, pool == null ? 0 : pool.getWorld().provider.getDimensionId());
ItemNBTHelper.setInt(stack, TAG_DIM, pool == null ? 0 : pool.getWorld().provider.getDimension());
}
public BlockPos getPoolCoords(ItemStack stack) {
@@ -168,7 +168,7 @@ public class ItemManaMirror extends ItemMod implements IManaItem, ICoordBoundIte
int dim = getDimension(stack);
World world = null;
for(World w : server.worldServers)
if(w.provider.getDimensionId() == dim) {
if(w.provider.getDimension() == dim) {
world = w;
break;
}
@@ -33,7 +33,7 @@ public class ItemOpenBucket extends ItemMod {
if(RayTraceResult == null)
return par1ItemStack;
else {
if(RayTraceResult.typeOfHit == RayTraceResult.MovingObjectType.BLOCK) {
if(RayTraceResult.typeOfHit == RayTraceResult.Type.BLOCK) {
BlockPos pos = RayTraceResult.getBlockPos();
if(!par2World.isBlockModifiable(par3EntityPlayer, pos))
@@ -25,6 +25,9 @@ import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.*;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.RayTraceResult;
import net.minecraft.util.text.translation.I18n;
import net.minecraft.world.World;
import vazkii.botania.api.internal.VanillaPacketDispatcher;
import vazkii.botania.api.state.BotaniaStateProps;
@@ -131,7 +134,7 @@ public class ItemTwigWand extends Item16Colors implements ICoordBoundItem {
return wanded;
} else if(BlockPistonRelay.playerPositions.containsKey(par2EntityPlayer.getName()) && !par3World.isRemote) {
BlockPistonRelay.DimWithPos bindPos = BlockPistonRelay.playerPositions.get(par2EntityPlayer.getName());
BlockPistonRelay.DimWithPos currentPos = new BlockPistonRelay.DimWithPos(par3World.provider.getDimensionId(), pos);
BlockPistonRelay.DimWithPos currentPos = new BlockPistonRelay.DimWithPos(par3World.provider.getDimension(), pos);
BlockPistonRelay.playerPositions.remove(par2EntityPlayer.getName());
BlockPistonRelay.mappedPositions.put(bindPos, currentPos);
@@ -269,7 +272,7 @@ public class ItemTwigWand extends Item16Colors implements ICoordBoundItem {
return bound;
RayTraceResult pos = Minecraft.getMinecraft().objectMouseOver;
if(pos != null && pos.typeOfHit == RayTraceResult.MovingObjectType.BLOCK) {
if(pos != null && pos.typeOfHit == RayTraceResult.Type.BLOCK) {
TileEntity tile = Minecraft.getMinecraft().theWorld.getTileEntity(pos.getBlockPos());
if(tile != null && tile instanceof ITileBound) {
BlockPos coords = ((ITileBound) tile).getBinding();
@@ -116,7 +116,7 @@ public class ItemTerraAxe extends ItemManasteelAxe implements ISequentialBreaker
return;
if(event.phase == Phase.END) {
int dim = event.world.provider.getDimensionId();
int dim = event.world.provider.getDimension();
if(blockSwappers.containsKey(dim)) {
Set<BlockSwapper> swappers = blockSwappers.get(dim);
@@ -157,7 +157,7 @@ public class ItemTerraAxe extends ItemManasteelAxe implements ISequentialBreaker
return swapper;
// If the mapping for this dimension doesn't exist, create it.
int dim = world.provider.getDimensionId();
int dim = world.provider.getDimension();
if(!blockSwappers.containsKey(dim))
blockSwappers.put(dim, new HashSet<>());
@@ -22,6 +22,10 @@ import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.*;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.RayTraceResult;
import net.minecraft.util.text.TextFormatting;
import net.minecraft.util.text.translation.I18n;
import net.minecraft.world.World;
import net.minecraftforge.fml.common.FMLLog;
import net.minecraftforge.oredict.RecipeSorter;
@@ -28,9 +28,9 @@ public class LensWarp extends Lens {
Block block = entity.worldObj.getBlockState(pos.getBlockPos()).getBlock();
if(block == ModBlocks.pistonRelay) {
BlockPistonRelay.DimWithPos key = BlockPistonRelay.mappedPositions.get(new BlockPistonRelay.DimWithPos(entity.worldObj.provider.getDimensionId(), pos.getBlockPos()));
BlockPistonRelay.DimWithPos key = BlockPistonRelay.mappedPositions.get(new BlockPistonRelay.DimWithPos(entity.worldObj.provider.getDimension(), pos.getBlockPos()));
if(key != null) {
if(key.dim == entity.worldObj.provider.getDimensionId()) {
if(key.dim == entity.worldObj.provider.getDimension()) {
entity.setPosition(key.blockPos.getX() + 0.5, key.blockPos.getY() + 0.5, key.blockPos.getZ() + 0.5);
burst.setCollidedAt(key.blockPos);
return false;
@@ -59,7 +59,7 @@ public class ItemManaResource extends ItemMod implements IFlowerComponent, IElve
boolean rightEvent = event.action == Action.RIGHT_CLICK_AIR;
ItemStack stack = event.entityPlayer.getCurrentEquippedItem();
boolean correctStack = stack != null && stack.getItem() == Items.glass_bottle;
boolean ender = event.world.provider.getDimensionId() == 1;
boolean ender = event.world.provider.getDimension() == 1;
if(rightEvent && correctStack && ender) {
RayTraceResult pos = ToolCommons.raytraceFromEntity(event.world, event.entityPlayer, false, 5F);
@@ -19,7 +19,7 @@ import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.stats.Achievement;
import net.minecraft.util.text.TextComponentTranslation;
import net.minecraft.util.ChatStyle;
import net.minecraft.util.text.Style;
import net.minecraft.util.text.TextFormatting;
import net.minecraft.world.World;
import vazkii.botania.api.item.IRelic;
@@ -69,12 +69,12 @@ public class ItemDice extends ItemRelic {
world.playSoundAtEntity(player, "random.bow", 0.5F, 0.4F / (world.rand.nextFloat() * 0.4F + 0.8F));
if(hasRelicAlready(player, relic)) {
player.addChatMessage(new TextComponentTranslation("botaniamisc.dudDiceRoll", relic + 1).setChatStyle(new ChatStyle().setColor(TextFormatting.DARK_GREEN)));
player.addChatMessage(new TextComponentTranslation("botaniamisc.dudDiceRoll", relic + 1).setChatStyle(new Style().setColor(TextFormatting.DARK_GREEN)));
stack.stackSize--;
return stack;
}
player.addChatMessage(new TextComponentTranslation("botaniamisc.diceRoll", relic + 1).setChatStyle(new ChatStyle().setColor(TextFormatting.DARK_GREEN)));
player.addChatMessage(new TextComponentTranslation("botaniamisc.diceRoll", relic + 1).setChatStyle(new Style().setColor(TextFormatting.DARK_GREEN)));
return relicStacks[relic].copy();
}
@@ -52,7 +52,7 @@ public class ItemFlugelEye extends ItemRelic implements ICoordBoundItem, IManaUs
ItemNBTHelper.setInt(stack, TAG_X, pos.getX());
ItemNBTHelper.setInt(stack, TAG_Y, pos.getY());
ItemNBTHelper.setInt(stack, TAG_Z, pos.getZ());
ItemNBTHelper.setInt(stack, TAG_DIMENSION, world.provider.getDimensionId());
ItemNBTHelper.setInt(stack, TAG_DIMENSION, world.provider.getDimension());
world.playSoundAtEntity(player, "mob.endermen.portal", 1F, 5F);
}
}
@@ -83,7 +83,7 @@ public class ItemFlugelEye extends ItemRelic implements ICoordBoundItem, IManaUs
int cost = (int) (MathHelper.pointDistanceSpace(x + 0.5, y + 0.5, z + 0.5, player.posX, player.posY, player.posZ) * 10);
if(y > -1 && dim == world.provider.getDimensionId() && ManaItemHandler.requestManaExact(stack, player, cost, true)) {
if(y > -1 && dim == world.provider.getDimension() && ManaItemHandler.requestManaExact(stack, player, cost, true)) {
moveParticlesAndSound(player);
if(player instanceof EntityPlayerMP && !world.isRemote)
((EntityPlayerMP) player).playerNetServerHandler.setPlayerLocation(x + 0.5, y + 1.6, z + 0.5, player.rotationYaw, player.rotationPitch);
@@ -31,7 +31,7 @@ public class ItemWaterRod extends ItemMod implements IManaUsingItem {
// Adapted from bucket code
RayTraceResult mop = getRayTraceResultFromPlayer(par3World, par2EntityPlayer, false);
if (mop != null && mop.typeOfHit == RayTraceResult.MovingObjectType.BLOCK) {
if (mop != null && mop.typeOfHit == RayTraceResult.Type.BLOCK) {
BlockPos hitPos = mop.getBlockPos();
if(!par3World.isBlockModifiable(par2EntityPlayer, hitPos))
return false;
@@ -19,7 +19,7 @@ import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.GuiScreen;
import net.minecraft.client.renderer.GlStateManager;
import net.minecraft.client.renderer.RenderHelper;
import net.minecraft.client.renderer.entity.RenderItem;
import net.minecraft.client.renderer.RenderItem;
import net.minecraft.item.ItemStack;
import net.minecraft.util.text.TextFormatting;
import net.minecraft.util.text.translation.I18n;
@@ -19,7 +19,7 @@ import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.GuiScreen;
import net.minecraft.client.renderer.GlStateManager;
import net.minecraft.client.renderer.RenderHelper;
import net.minecraft.client.renderer.entity.RenderItem;
import net.minecraft.client.renderer.RenderItem;
import net.minecraft.client.renderer.texture.TextureManager;
import net.minecraft.entity.EntityList;
import net.minecraft.item.ItemStack;
@@ -16,7 +16,7 @@ import java.net.URI;
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.GuiButton;
import net.minecraft.util.text.TextComponentTranslation;
import net.minecraft.util.ChatStyle;
import net.minecraft.util.text.Style;
import net.minecraft.util.text.TextFormatting;
import net.minecraft.util.text.translation.I18n;
import vazkii.botania.api.internal.IGuiLexiconEntry;
@@ -67,7 +67,7 @@ public class PageTutorial extends PageText {
if(button == buttonText) {
GuiLexicon.startTutorial();
Minecraft.getMinecraft().displayGuiScreen(new GuiLexicon());
Minecraft.getMinecraft().thePlayer.addChatMessage(new TextComponentTranslation("botaniamisc.tutorialStarted").setChatStyle(new ChatStyle().setColor(TextFormatting.GREEN)));
Minecraft.getMinecraft().thePlayer.addChatMessage(new TextComponentTranslation("botaniamisc.tutorialStarted").setChatStyle(new Style().setColor(TextFormatting.GREEN)));
} else if(button == buttonVideo && Desktop.isDesktopSupported()) {
try {
Desktop.getDesktop().browse(new URI("https://www.youtube.com/watch?v=rx0xyejC6fI"));
@@ -45,7 +45,7 @@ public final class LibObfuscation {
// Entity
public static final String[] IS_IMMUNE_TO_FIRE = new String[] { "isImmuneToFire", "field_70178_ae", "ab" };
// ItemReed
// ItemBlockSpecial
public static final String[] REED_ITEM = new String[] { "block", "field_150935_a", "a" };
// EntityAnimal
@@ -54,7 +54,7 @@ public final class SkyblockWorldEvents {
World world = player.worldObj;
if(WorldTypeSkyblock.isWorldSkyblock(world)) {
BlockPos coords = world.getSpawnPoint();
if(world.getBlockState(coords.down(4)).getBlock() != Blocks.bedrock && world.provider.getDimensionId() == 0)
if(world.getBlockState(coords.down(4)).getBlock() != Blocks.bedrock && world.provider.getDimension() == 0)
spawnPlayer(player, coords, false);
}
@@ -82,7 +82,7 @@ public final class SkyblockWorldEvents {
} else if(equipped != null && equipped.getItem() == Items.bowl && event.action == Action.RIGHT_CLICK_BLOCK && !event.world.isRemote) {
RayTraceResult RayTraceResult = ToolCommons.raytraceFromEntity(event.world, event.entityPlayer, true, 4.5F);
if(RayTraceResult != null) {
if (RayTraceResult.typeOfHit == RayTraceResult.MovingObjectType.BLOCK) {
if (RayTraceResult.typeOfHit == RayTraceResult.Type.BLOCK) {
if(event.world.getBlockState(RayTraceResult.getBlockPos()).getBlock().getMaterial() == Material.water) {
--equipped.stackSize;
@@ -127,7 +127,7 @@ public final class SkyblockWorldEvents {
if(player instanceof EntityPlayerMP) {
EntityPlayerMP pmp = (EntityPlayerMP) player;
pmp.setPositionAndUpdate(pos.getX() + 0.5, pos.getY() + 1.6, pos.getZ() + 0.5);
pmp.setSpawnChunk(pos, true, player.worldObj.provider.getDimensionId());
pmp.setSpawnChunk(pos, true, player.worldObj.provider.getDimension());
player.inventory.addItemStackToInventory(new ItemStack(ModItems.lexicon));
}