diff --git a/src/main/java/tconstruct/TConstruct.java b/src/main/java/tconstruct/TConstruct.java index 0cbd56aa..02dc341a 100644 --- a/src/main/java/tconstruct/TConstruct.java +++ b/src/main/java/tconstruct/TConstruct.java @@ -1,7 +1,6 @@ package tconstruct; import tconstruct.achievements.TAchievements; - import cpw.mods.fml.common.*; import cpw.mods.fml.common.Mod.EventHandler; import cpw.mods.fml.common.Mod.Instance; @@ -11,8 +10,10 @@ import cpw.mods.fml.common.registry.*; import cpw.mods.fml.relauncher.Side; import java.util.UUID; -import java.util.logging.Logger; -import net.minecraft.crash.CallableMinecraftVersion; + +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; + import net.minecraft.world.gen.structure.MapGenStructureIO; import net.minecraftforge.common.MinecraftForge; import tconstruct.client.event.EventCloakRender; @@ -48,7 +49,7 @@ public class TConstruct public static final int liquidUpdateAmount = 6; // Shared mod logger - public static final Logger logger = Logger.getLogger("TConstruct"); + public static final Logger logger = LogManager.getLogger("TConstruct"); /* Instance of this mod, used for grabbing prototype fields */ @Instance("TConstruct") @@ -59,7 +60,7 @@ public class TConstruct public TConstruct() { - logger.setParent(FMLCommonHandler.instance().getFMLLogger()); + //logger.setParent(FMLCommonHandler.instance().getFMLLogger()); if (Loader.isModLoaded("Natura")) { System.out.println("[TConstruct] Natura, what are we going to do tomorrow night?"); @@ -124,7 +125,7 @@ public class TConstruct } catch (Throwable e) { - logger.severe("Error registering TConstruct Structures with Vanilla Minecraft: this is expected in versions earlier than 1.6.4"); + logger.error("Error registering TConstruct Structures with Vanilla Minecraft: this is expected in versions earlier than 1.6.4"); } } diff --git a/src/main/java/tconstruct/blocks/BlockLandmine.java b/src/main/java/tconstruct/blocks/BlockLandmine.java index ff5d2cef..dfe75bf9 100644 --- a/src/main/java/tconstruct/blocks/BlockLandmine.java +++ b/src/main/java/tconstruct/blocks/BlockLandmine.java @@ -15,6 +15,7 @@ import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.item.EntityItem; import net.minecraft.entity.item.EntityTNTPrimed; import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.tileentity.TileEntity; @@ -54,7 +55,7 @@ public class BlockLandmine extends BlockContainer @Override public int getLightValue (IBlockAccess world, int x, int y, int z) { - if (world.getBlockId(x, y, z) == this.blockID && world.getBlockTileEntity(x, y, z) instanceof TileEntityLandmine) + if (world.func_147439_a(x, y, z) == (Block) this && world.getBlockTileEntity(x, y, z) instanceof TileEntityLandmine) { TileEntityLandmine te = (TileEntityLandmine) world.getBlockTileEntity(x, y, z); @@ -123,7 +124,7 @@ public class BlockLandmine extends BlockContainer @Override public void registerIcons (IIconRegister par1IconRegister) { - this.blockIcon = par1IconRegister.registerIcon("tinker:Landmine"); + this.field_149761_L = par1IconRegister.registerIcon("tinker:Landmine"); } @Override @@ -192,7 +193,7 @@ public class BlockLandmine extends BlockContainer } @Override - public void getSubBlocks (int par1, CreativeTabs par2CreativeTabs, List par3List) + public void getSubBlocks (Item par1, CreativeTabs par2CreativeTabs, List par3List) { par3List.add(new ItemStack(par1, 1, 0)); par3List.add(new ItemStack(par1, 1, 1)); @@ -210,16 +211,16 @@ public class BlockLandmine extends BlockContainer public boolean canPlaceBlockOnSide (World par1World, int par2, int par3, int par4, int par5) { ForgeDirection dir = ForgeDirection.getOrientation(par5); - return (dir == DOWN && par1World.isBlockSolidOnSide(par2, par3 + 1, par4, DOWN)) || (dir == UP && par1World.isBlockSolidOnSide(par2, par3 - 1, par4, UP)) - || (dir == NORTH && par1World.isBlockSolidOnSide(par2, par3, par4 + 1, NORTH)) || (dir == SOUTH && par1World.isBlockSolidOnSide(par2, par3, par4 - 1, SOUTH)) - || (dir == WEST && par1World.isBlockSolidOnSide(par2 + 1, par3, par4, WEST)) || (dir == EAST && par1World.isBlockSolidOnSide(par2 - 1, par3, par4, EAST)); + return (dir == DOWN && par1World.isSideSolid(par2, par3 + 1, par4, DOWN)) || (dir == UP && par1World.isSideSolid(par2, par3 - 1, par4, UP)) + || (dir == NORTH && par1World.isSideSolid(par2, par3, par4 + 1, NORTH)) || (dir == SOUTH && par1World.isSideSolid(par2, par3, par4 - 1, SOUTH)) + || (dir == WEST && par1World.isSideSolid(par2 + 1, par3, par4, WEST)) || (dir == EAST && par1World.isSideSolid(par2 - 1, par3, par4, EAST)); } @Override public boolean canPlaceBlockAt (World par1World, int par2, int par3, int par4) { - return par1World.isBlockSolidOnSide(par2 - 1, par3, par4, EAST) || par1World.isBlockSolidOnSide(par2 + 1, par3, par4, WEST) || par1World.isBlockSolidOnSide(par2, par3, par4 - 1, SOUTH) - || par1World.isBlockSolidOnSide(par2, par3, par4 + 1, NORTH) || par1World.isBlockSolidOnSide(par2, par3 - 1, par4, UP) || par1World.isBlockSolidOnSide(par2, par3 + 1, par4, DOWN); + return par1World.isSideSolid(par2 - 1, par3, par4, EAST) || par1World.isSideSolid(par2 + 1, par3, par4, WEST) || par1World.isSideSolid(par2, par3, par4 - 1, SOUTH) + || par1World.isSideSolid(par2, par3, par4 + 1, NORTH) || par1World.isSideSolid(par2, par3 - 1, par4, UP) || par1World.isSideSolid(par2, par3 + 1, par4, DOWN); } @Override @@ -229,32 +230,32 @@ public class BlockLandmine extends BlockContainer int k1 = par9 & 7; byte b0 = -1; - if (par5 == 0 && par1World.isBlockSolidOnSide(par2, par3 + 1, par4, DOWN)) + if (par5 == 0 && par1World.isSideSolid(par2, par3 + 1, par4, DOWN)) { b0 = 0; } - if (par5 == 1 && par1World.isBlockSolidOnSide(par2, par3 - 1, par4, UP)) + if (par5 == 1 && par1World.isSideSolid(par2, par3 - 1, par4, UP)) { b0 = 5; } - if (par5 == 2 && par1World.isBlockSolidOnSide(par2, par3, par4 + 1, NORTH)) + if (par5 == 2 && par1World.isSideSolid(par2, par3, par4 + 1, NORTH)) { b0 = 4; } - if (par5 == 3 && par1World.isBlockSolidOnSide(par2, par3, par4 - 1, SOUTH)) + if (par5 == 3 && par1World.isSideSolid(par2, par3, par4 - 1, SOUTH)) { b0 = 3; } - if (par5 == 4 && par1World.isBlockSolidOnSide(par2 + 1, par3, par4, WEST)) + if (par5 == 4 && par1World.isSideSolid(par2 + 1, par3, par4, WEST)) { b0 = 2; } - if (par5 == 5 && par1World.isBlockSolidOnSide(par2 - 1, par3, par4, EAST)) + if (par5 == 5 && par1World.isSideSolid(par2 - 1, par3, par4, EAST)) { b0 = 1; } @@ -334,42 +335,42 @@ public class BlockLandmine extends BlockContainer int i1 = par1World.getBlockMetadata(par2, par3, par4) & 7; boolean flag = false; - if (!par1World.isBlockSolidOnSide(par2 - 1, par3, par4, EAST) && i1 == 1) + if (!par1World.isSideSolid(par2 - 1, par3, par4, EAST) && i1 == 1) { flag = true; } - if (!par1World.isBlockSolidOnSide(par2 + 1, par3, par4, WEST) && i1 == 2) + if (!par1World.isSideSolid(par2 + 1, par3, par4, WEST) && i1 == 2) { flag = true; } - if (!par1World.isBlockSolidOnSide(par2, par3, par4 - 1, SOUTH) && i1 == 3) + if (!par1World.isSideSolid(par2, par3, par4 - 1, SOUTH) && i1 == 3) { flag = true; } - if (!par1World.isBlockSolidOnSide(par2, par3, par4 + 1, NORTH) && i1 == 4) + if (!par1World.isSideSolid(par2, par3, par4 + 1, NORTH) && i1 == 4) { flag = true; } - if (!par1World.isBlockSolidOnSide(par2, par3 - 1, par4, UP) && i1 == 5) + if (!par1World.isSideSolid(par2, par3 - 1, par4, UP) && i1 == 5) { flag = true; } - if (!par1World.isBlockSolidOnSide(par2, par3 - 1, par4, UP) && i1 == 6) + if (!par1World.isSideSolid(par2, par3 - 1, par4, UP) && i1 == 6) { flag = true; } - if (!par1World.isBlockSolidOnSide(par2, par3 + 1, par4, DOWN) && i1 == 0) + if (!par1World.isSideSolid(par2, par3 + 1, par4, DOWN) && i1 == 0) { flag = true; } - if (!par1World.isBlockSolidOnSide(par2, par3 + 1, par4, DOWN) && i1 == 7) + if (!par1World.isSideSolid(par2, par3 + 1, par4, DOWN) && i1 == 7) { flag = true; } diff --git a/src/main/java/tconstruct/blocks/GlassBlockConnected.java b/src/main/java/tconstruct/blocks/GlassBlockConnected.java index 1676ec94..a5dd6f49 100644 --- a/src/main/java/tconstruct/blocks/GlassBlockConnected.java +++ b/src/main/java/tconstruct/blocks/GlassBlockConnected.java @@ -587,8 +587,8 @@ public class GlassBlockConnected extends MantleBlock @Override public boolean shouldSideBeRendered (IBlockAccess par1IBlockAccess, int par2, int par3, int par4, int par5) { - int i1 = par1IBlockAccess.getBlockId(par2, par3, par4); - return i1 == this.blockID ? false : super.shouldSideBeRendered(par1IBlockAccess, par2, par3, par4, par5); + Block b = par1IBlockAccess.func_147439_a(par2, par3, par4); + return b == (Block) this ? false : super.shouldSideBeRendered(par1IBlockAccess, par2, par3, par4, par5); } @Override diff --git a/src/main/java/tconstruct/blocks/StoneTorch.java b/src/main/java/tconstruct/blocks/StoneTorch.java index 6ead85d3..6a499779 100644 --- a/src/main/java/tconstruct/blocks/StoneTorch.java +++ b/src/main/java/tconstruct/blocks/StoneTorch.java @@ -73,8 +73,8 @@ public class StoneTorch extends MantleBlock } else { - int l = par1World.getBlockId(par2, par3, par4); - return (Block.blocksList[l] != null && Block.blocksList[l].canPlaceTorchOnTop(par1World, par2, par3, par4)); + Block b = par1World.func_147439_a(par2, par3, par4); + return (b != null && b.canPlaceTorchOnTop(par1World, par2, par3, par4)); } } @@ -83,8 +83,8 @@ public class StoneTorch extends MantleBlock */ public boolean canPlaceBlockAt (World par1World, int par2, int par3, int par4) { - return par1World.isBlockSolidOnSide(par2 - 1, par3, par4, EAST, true) || par1World.isBlockSolidOnSide(par2 + 1, par3, par4, WEST, true) - || par1World.isBlockSolidOnSide(par2, par3, par4 - 1, SOUTH, true) || par1World.isBlockSolidOnSide(par2, par3, par4 + 1, NORTH, true) + return par1World.isSideSolid(par2 - 1, par3, par4, EAST, true) || par1World.isSideSolid(par2 + 1, par3, par4, WEST, true) + || par1World.isSideSolid(par2, par3, par4 - 1, SOUTH, true) || par1World.isSideSolid(par2, par3, par4 + 1, NORTH, true) || canPlaceTorchOn(par1World, par2, par3 - 1, par4); } @@ -101,19 +101,19 @@ public class StoneTorch extends MantleBlock { j1 = 5; } - else if (par1World.isBlockSolidOnSide(par2, par3, par4 + 1, NORTH, true)) + else if (par1World.isSideSolid(par2, par3, par4 + 1, NORTH, true)) { j1 = 4; } - else if (par1World.isBlockSolidOnSide(par2, par3, par4 - 1, SOUTH, true)) + else if (par1World.isSideSolid(par2, par3, par4 - 1, SOUTH, true)) { j1 = 3; } - else if (par1World.isBlockSolidOnSide(par2 + 1, par3, par4, WEST, true)) + else if (par1World.isSideSolid(par2 + 1, par3, par4, WEST, true)) { j1 = 2; } - else if (par1World.isBlockSolidOnSide(par2 - 1, par3, par4, EAST, true)) + else if (par1World.isSideSolid(par2 - 1, par3, par4, EAST, true)) { j1 = 1; } @@ -124,22 +124,22 @@ public class StoneTorch extends MantleBlock j1 = 5; } - if (par5 == 2 && par1World.isBlockSolidOnSide(par2, par3, par4 + 1, NORTH, true)) + if (par5 == 2 && par1World.isSideSolid(par2, par3, par4 + 1, NORTH, true)) { j1 = 4; } - if (par5 == 3 && par1World.isBlockSolidOnSide(par2, par3, par4 - 1, SOUTH, true)) + if (par5 == 3 && par1World.isSideSolid(par2, par3, par4 - 1, SOUTH, true)) { j1 = 3; } - if (par5 == 4 && par1World.isBlockSolidOnSide(par2 + 1, par3, par4, WEST, true)) + if (par5 == 4 && par1World.isSideSolid(par2 + 1, par3, par4, WEST, true)) { j1 = 2; } - if (par5 == 5 && par1World.isBlockSolidOnSide(par2 - 1, par3, par4, EAST, true)) + if (par5 == 5 && par1World.isSideSolid(par2 - 1, par3, par4, EAST, true)) { j1 = 1; } @@ -169,22 +169,22 @@ public class StoneTorch extends MantleBlock int i1 = par1World.getBlockMetadata(par2, par3, par4); boolean flag = false; - if (!par1World.isBlockSolidOnSide(par2 - 1, par3, par4, EAST, true) && i1 == 1) + if (!par1World.isSideSolid(par2 - 1, par3, par4, EAST, true) && i1 == 1) { flag = true; } - if (!par1World.isBlockSolidOnSide(par2 + 1, par3, par4, WEST, true) && i1 == 2) + if (!par1World.isSideSolid(par2 + 1, par3, par4, WEST, true) && i1 == 2) { flag = true; } - if (!par1World.isBlockSolidOnSide(par2, par3, par4 - 1, SOUTH, true) && i1 == 3) + if (!par1World.isSideSolid(par2, par3, par4 - 1, SOUTH, true) && i1 == 3) { flag = true; } - if (!par1World.isBlockSolidOnSide(par2, par3, par4 + 1, NORTH, true) && i1 == 4) + if (!par1World.isSideSolid(par2, par3, par4 + 1, NORTH, true) && i1 == 4) { flag = true; } @@ -197,7 +197,6 @@ public class StoneTorch extends MantleBlock if (flag) { this.dropBlockAsItem(par1World, par2, par3, par4, par1World.getBlockMetadata(par2, par3, par4), 0); - par1World.setBlockToAir(par2, par3, par4); return true; } else @@ -219,7 +218,7 @@ public class StoneTorch extends MantleBlock { if (!this.canPlaceBlockAt(par1World, par2, par3, par4)) { - if (par1World.getBlockId(par2, par3, par4) == this.blockID) + if (par1World.func_147439_a(par2, par3, par4) == (Block) this) { this.dropBlockAsItem(par1World, par2, par3, par4, par1World.getBlockMetadata(par2, par3, par4), 0); par1World.setBlockToAir(par2, par3, par4); diff --git a/src/main/java/tconstruct/blocks/logic/FrypanLogic.java b/src/main/java/tconstruct/blocks/logic/FrypanLogic.java index 143c4568..8bea233c 100644 --- a/src/main/java/tconstruct/blocks/logic/FrypanLogic.java +++ b/src/main/java/tconstruct/blocks/logic/FrypanLogic.java @@ -244,7 +244,7 @@ public class FrypanLogic extends EquipLogic implements IActiveLogic return 2400; } - if (block.blockMaterial == Material.wood) + if (block.func_149688_o() == Material.wood) { return 300; } diff --git a/src/main/java/tconstruct/blocks/logic/FurnaceLogic.java b/src/main/java/tconstruct/blocks/logic/FurnaceLogic.java index a9f5cf3a..16c5df90 100644 --- a/src/main/java/tconstruct/blocks/logic/FurnaceLogic.java +++ b/src/main/java/tconstruct/blocks/logic/FurnaceLogic.java @@ -222,7 +222,7 @@ public class FurnaceLogic extends InventoryLogic implements IActiveLogic, IFacin return 1200; } - if (block.blockMaterial == Material.wood) + if (block.func_149688_o() == Material.wood) { return 300; } diff --git a/src/main/java/tconstruct/blocks/logic/SmelteryLogic.java b/src/main/java/tconstruct/blocks/logic/SmelteryLogic.java index c5047152..78341885 100644 --- a/src/main/java/tconstruct/blocks/logic/SmelteryLogic.java +++ b/src/main/java/tconstruct/blocks/logic/SmelteryLogic.java @@ -13,6 +13,7 @@ import net.minecraft.entity.passive.EntityHorse; import net.minecraft.entity.passive.EntityVillager; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.InventoryPlayer; +import net.minecraft.init.Blocks; import net.minecraft.inventory.Container; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; @@ -711,42 +712,37 @@ public class SmelteryLogic extends InventoryLogic implements IActiveLogic, IFaci public void alignInitialPlacement (int x, int y, int z) { - int northID = this.field_145850_b.getBlockId(x, y, z + 1); - int southID = field_145850_b.getBlockId(x, y, z - 1); - int eastID = field_145850_b.getBlockId(x + 1, y, z); - int westID = field_145850_b.getBlockId(x - 1, y, z); + Block northBlock = field_145850_b.func_147439_a(x, y, z + 1); + Block southBlock = field_145850_b.func_147439_a(x, y, z - 1); + Block eastBlock = field_145850_b.func_147439_a(x + 1, y, z); + Block westBlock = field_145850_b.func_147439_a(x - 1, y, z); - Block northBlock = Block.blocksList[northID]; - Block southBlock = Block.blocksList[southID]; - Block eastBlock = Block.blocksList[eastID]; - Block westBlock = Block.blocksList[westID]; - - if ((northBlock == null || northBlock.isAirBlock(field_145850_b, x, y, z + 1)) && (southBlock == null || southBlock.isAirBlock(field_145850_b, x, y, z - 1)) - && (eastBlock == null || eastBlock.isAirBlock(field_145850_b, x + 1, y, z)) && (westBlock == null || westBlock.isAirBlock(field_145850_b, x - 1, y, z))) + if ((northBlock == null || northBlock == Blocks.air) && (southBlock == null || southBlock == Blocks.air) + && (eastBlock == null || eastBlock == Blocks.air) && (westBlock == null || westBlock == Blocks.air)) { checkValidStructure(x, y, z); } - else if ((northBlock != null && !northBlock.isAirBlock(field_145850_b, x, y, z + 1)) && (southBlock == null || southBlock.isAirBlock(field_145850_b, x, y, z - 1)) - && (eastBlock == null || eastBlock.isAirBlock(field_145850_b, x + 1, y, z)) && (westBlock == null || westBlock.isAirBlock(field_145850_b, x - 1, y, z))) + else if ((northBlock != null && !(northBlock == Blocks.air) && (southBlock == null || southBlock == Blocks.air) + && (eastBlock == null || eastBlock == Blocks.air) && (westBlock == null || westBlock == Blocks.air))) { checkValidStructure(x, y, z - 1); } - else if ((northBlock == null || northBlock.isAirBlock(field_145850_b, x, y, z + 1)) && (southBlock != null && !southBlock.isAirBlock(field_145850_b, x, y, z - 1)) - && (eastBlock == null || eastBlock.isAirBlock(field_145850_b, x + 1, y, z)) && (westBlock == null || westBlock.isAirBlock(field_145850_b, x - 1, y, z))) + else if ((northBlock == null || northBlock == Blocks.air) && (southBlock != null && !(southBlock == Blocks.air)) + && (eastBlock == null || eastBlock == Blocks.air) && (westBlock == null || westBlock == Blocks.air)) { checkValidStructure(x, y, z + 1); } - else if ((northBlock == null || northBlock.isAirBlock(field_145850_b, x, y, z + 1)) && (southBlock == null || southBlock.isAirBlock(field_145850_b, x, y, z - 1)) - && (eastBlock != null && !eastBlock.isAirBlock(field_145850_b, x + 1, y, z)) && (westBlock == null || westBlock.isAirBlock(field_145850_b, x - 1, y, z))) + else if ((northBlock == null || northBlock == Blocks.air) && (southBlock == null || southBlock == Blocks.air) + && (eastBlock != null && !(eastBlock == Blocks.air)) && (westBlock == null || westBlock == Blocks.air)) { checkValidStructure(x - 1, y, z); } - else if ((northBlock == null || northBlock.isAirBlock(field_145850_b, x, y, z + 1)) && (southBlock == null || southBlock.isAirBlock(field_145850_b, x, y, z - 1)) - && (eastBlock == null || eastBlock.isAirBlock(field_145850_b, x + 1, y, z)) && (westBlock != null && !westBlock.isAirBlock(field_145850_b, x - 1, y, z))) + else if ((northBlock == null || northBlock == Blocks.air) && (southBlock == null || southBlock == Blocks.air) + && (eastBlock == null || eastBlock == Blocks.air) && (westBlock != null && !(westBlock == Blocks.air))) { checkValidStructure(x + 1, y, z); } @@ -796,8 +792,8 @@ public class SmelteryLogic extends InventoryLogic implements IActiveLogic, IFaci { for (int zPos = z - 1; zPos <= z + 1; zPos++) { - block = Block.blocksList[field_145850_b.getBlockId(xPos, y, zPos)]; - if (block != null && !block.isAirBlock(field_145850_b, xPos, y, zPos)) + block = field_145850_b.func_147439_a(xPos, y, zPos); + if (block != null && block != Blocks.air) return false; } } @@ -829,8 +825,8 @@ public class SmelteryLogic extends InventoryLogic implements IActiveLogic, IFaci { for (int zPos = z - 1; zPos <= z + 1; zPos++) { - Block block = Block.blocksList[field_145850_b.getBlockId(xPos, y, zPos)]; - if (block != null && !block.isAirBlock(field_145850_b, xPos, y, zPos)) + Block block = field_145850_b.func_147439_a(xPos, y, zPos); + if (block != null && !(block == Blocks.air)) return count; } } @@ -863,11 +859,10 @@ public class SmelteryLogic extends InventoryLogic implements IActiveLogic, IFaci { for (int zPos = z - 1; zPos <= z + 1; zPos++) { - int blockID = field_145850_b.getBlockId(xPos, y, zPos); - Block block = Block.blocksList[blockID]; - if (block != null && !block.isAirBlock(field_145850_b, xPos, y, zPos)) + Block block = field_145850_b.func_147439_a(xPos, y, zPos); + if (block != null && block != Blocks.air) { - if (validBlockID(blockID)) + if (validBlock(block)) return validateBottom(x, y, z, count); else return count; @@ -902,7 +897,7 @@ public class SmelteryLogic extends InventoryLogic implements IActiveLogic, IFaci { for (int zPos = z - 1; zPos <= z + 1; zPos++) { - if (validBlockID(field_145850_b.getBlockId(xPos, y, zPos)) && (field_145850_b.getBlockMetadata(xPos, y, zPos) >= 2)) + if (validBlock(field_145850_b.func_147439_a(xPos, y, zPos)) && (field_145850_b.getBlockMetadata(xPos, y, zPos) >= 2)) bottomBricks++; } } @@ -921,8 +916,8 @@ public class SmelteryLogic extends InventoryLogic implements IActiveLogic, IFaci int checkBricks (int x, int y, int z) { int tempBricks = 0; - int blockID = field_145850_b.getBlockId(x, y, z); - if (validBlockID(blockID) || validTankID(blockID)) + Block block = field_145850_b.func_147439_a(x, y, z); + if (validBlock(block) || validTankID(block)) { TileEntity te = field_145850_b.getBlockTileEntity(x, y, z); if (te == this) diff --git a/src/main/java/tconstruct/blocks/logic/ToolStationLogic.java b/src/main/java/tconstruct/blocks/logic/ToolStationLogic.java index 2cc171c2..95024c7e 100644 --- a/src/main/java/tconstruct/blocks/logic/ToolStationLogic.java +++ b/src/main/java/tconstruct/blocks/logic/ToolStationLogic.java @@ -60,7 +60,7 @@ public class ToolStationLogic extends InventoryLogic implements ISidedInventory buildTool(toolName); if (this.getWorld() != null) { - this.blockMetadata = this.getWorld().getBlockMetadata(this.xCoord, this.yCoord, this.zCoord); + this.field_145847_g = this.getWorld().getBlockMetadata(this.xCoord, this.yCoord, this.zCoord); this.getWorld().markTileEntityChunkModified(this.xCoord, this.yCoord, this.zCoord, this); } } diff --git a/src/main/java/tconstruct/client/gui/AdaptiveSmelteryGui.java b/src/main/java/tconstruct/client/gui/AdaptiveSmelteryGui.java index 32edd620..ba4d979a 100644 --- a/src/main/java/tconstruct/client/gui/AdaptiveSmelteryGui.java +++ b/src/main/java/tconstruct/client/gui/AdaptiveSmelteryGui.java @@ -38,7 +38,7 @@ public class AdaptiveSmelteryGui extends NewContainerGui { super((ActiveContainer) smeltery.getGuiContainer(inventoryplayer, world, x, y, z)); logic = smeltery; - username = inventoryplayer.player.username; + username = inventoryplayer.player.getDisplayName(); xSize = 248; scomp = logic.getSmeltery(); multitank = logic.getMultiTank(); diff --git a/src/main/java/tconstruct/entity/projectile/ArrowEntity.java b/src/main/java/tconstruct/entity/projectile/ArrowEntity.java index 5990bed0..338a2146 100644 --- a/src/main/java/tconstruct/entity/projectile/ArrowEntity.java +++ b/src/main/java/tconstruct/entity/projectile/ArrowEntity.java @@ -584,7 +584,7 @@ public class ArrowEntity extends EntityArrow implements IEntityAdditionalSpawnDa public void writeEntityToNBT (NBTTagCompound tags) { super.writeEntityToNBT(tags); - tags.setCompoundTag("Throwable", this.returnStack.writeToNBT(new NBTTagCompound())); + tags.setTag("Throwable", this.returnStack.writeToNBT(new NBTTagCompound())); } public void readEntityFromNBT (NBTTagCompound tags) @@ -664,7 +664,7 @@ public class ArrowEntity extends EntityArrow implements IEntityAdditionalSpawnDa case 1: toolTag.setInteger("Effect1", data.readInt()); } - compound.setCompoundTag("InfiTool", toolTag); + compound.setTag("InfiTool", toolTag); returnStack.setTagCompound(compound); } diff --git a/src/main/java/tconstruct/inventory/AdaptiveSmelteryContainer.java b/src/main/java/tconstruct/inventory/AdaptiveSmelteryContainer.java index 6426a551..1c072f1e 100644 --- a/src/main/java/tconstruct/inventory/AdaptiveSmelteryContainer.java +++ b/src/main/java/tconstruct/inventory/AdaptiveSmelteryContainer.java @@ -193,7 +193,7 @@ public class AdaptiveSmelteryContainer extends ActiveContainer slot = (Slot) this.inventorySlots.get(slotPos); slotStack = slot.getStack(); - if (slotStack != null && slotStack.itemID == inputStack.itemID && (!inputStack.getHasSubtypes() || inputStack.getItemDamage() == slotStack.getItemDamage()) + if (slotStack != null && slotStack == inputStack && (!inputStack.getHasSubtypes() || inputStack.getItemDamage() == slotStack.getItemDamage()) && ItemStack.areItemStackTagsEqual(inputStack, slotStack)) { int l = slotStack.stackSize + inputStack.stackSize; diff --git a/src/main/java/tconstruct/items/tools/Battleaxe.java b/src/main/java/tconstruct/items/tools/Battleaxe.java index 4acb9a04..642a6969 100644 --- a/src/main/java/tconstruct/items/tools/Battleaxe.java +++ b/src/main/java/tconstruct/items/tools/Battleaxe.java @@ -46,7 +46,7 @@ public class Battleaxe extends HarvestTool @Override public boolean onBlockDestroyed (ItemStack itemstack, World world, Block b, int x, int y, int z, EntityLivingBase player) { - if (b != null && b.blockMaterial == Material.leaves) + if (b != null && b.func_149688_o() == Material.leaves) return false; return AbilityHelper.onBlockChanged(itemstack, world, b, x, y, z, player, random); @@ -252,7 +252,7 @@ public class Battleaxe extends HarvestTool for (int yPos = y + 1; yPos < y + 9; yPos++) { Block block = world.func_147439_a(x, yPos, z); - if (!(tags.getBoolean("Broken")) && block != null && block.blockMaterial == Material.wood) + if (!(tags.getBoolean("Broken")) && block != null && block.func_149688_o() == Material.wood) { Block localblock = world.func_147439_a(x, yPos, z); int localMeta = world.getBlockMetadata(x, yPos, z); @@ -269,7 +269,7 @@ public class Battleaxe extends HarvestTool if (!cancelHarvest) { - if (block != null && block.blockMaterial == Material.wood) + if (block != null && block.func_149688_o() == Material.wood) { localMeta = world.getBlockMetadata(x, yPos, z); if (!player.capabilities.isCreativeMode) diff --git a/src/main/java/tconstruct/items/tools/Excavator.java b/src/main/java/tconstruct/items/tools/Excavator.java index 3e37b123..2d5609ce 100644 --- a/src/main/java/tconstruct/items/tools/Excavator.java +++ b/src/main/java/tconstruct/items/tools/Excavator.java @@ -154,7 +154,7 @@ public class Excavator extends HarvestTool boolean validStart = false; for (int iter = 0; iter < materials.length; iter++) { - if (materials[iter] == block.blockMaterial) + if (materials[iter] == block.func_149688_o()) { validStart = true; break; @@ -213,7 +213,7 @@ public class Excavator extends HarvestTool { for (int iter = 0; iter < materials.length; iter++) { - if (materials[iter] == block.blockMaterial) + if (materials[iter] == block.func_149688_o()) { if (!player.capabilities.isCreativeMode) { @@ -257,7 +257,7 @@ public class Excavator extends HarvestTool Material[] materials = getEffectiveMaterials(); for (int i = 0; i < materials.length; i++) { - if (materials[i] == block.blockMaterial) + if (materials[i] == block.func_149688_o()) { float mineSpeed = tags.getInteger("MiningSpeed"); int heads = 1; diff --git a/src/main/java/tconstruct/items/tools/Hammer.java b/src/main/java/tconstruct/items/tools/Hammer.java index 4502db61..5c97662d 100644 --- a/src/main/java/tconstruct/items/tools/Hammer.java +++ b/src/main/java/tconstruct/items/tools/Hammer.java @@ -233,9 +233,8 @@ public class Hammer extends HarvestTool return false; World world = player.worldObj; - final int blockID = world.getBlockId(x, y, z); + final Block block = world.func_147439_a(x, y, z); final int meta = world.getBlockMetadata(x, y, z); - final Block block = Block.blocksList[blockID]; if (!stack.hasTagCompound()) return false; @@ -247,7 +246,7 @@ public class Hammer extends HarvestTool boolean validStart = false; for (int iter = 0; iter < materials.length; iter++) { - if (materials[iter] == block.blockMaterial) + if (materials[iter] == block.func_149688_o()) { validStart = true; break; @@ -311,7 +310,7 @@ public class Hammer extends HarvestTool { for (int iter = 0; iter < materials.length; iter++) { - if (materials[iter] == localBlock.blockMaterial || localBlock == Block.silverfish) + if (materials[iter] == localBlock.func_149688_o() || localBlock == Block.silverfish) { if (!player.capabilities.isCreativeMode) { @@ -355,7 +354,7 @@ public class Hammer extends HarvestTool Material[] materials = getEffectiveMaterials(); for (int i = 0; i < materials.length; i++) { - if (materials[i] == block.blockMaterial) + if (materials[i] == block.func_149688_o()) { return getblockSpeed(tags, block, meta); } diff --git a/src/main/java/tconstruct/items/tools/Hatchet.java b/src/main/java/tconstruct/items/tools/Hatchet.java index b2d764df..328b47d1 100644 --- a/src/main/java/tconstruct/items/tools/Hatchet.java +++ b/src/main/java/tconstruct/items/tools/Hatchet.java @@ -37,7 +37,7 @@ public class Hatchet extends HarvestTool public boolean onBlockDestroyed (ItemStack itemstack, World world, int bID, int x, int y, int z, EntityLivingBase player) { Block block = Block.blocksList[bID]; - if (block != null && block.blockMaterial == Material.leaves) + if (block != null && block.func_149688_o() == Material.leaves) return false; return AbilityHelper.onBlockChanged(itemstack, world, bID, x, y, z, player, random); diff --git a/src/main/java/tconstruct/items/tools/LumberAxe.java b/src/main/java/tconstruct/items/tools/LumberAxe.java index e4f3f069..3aaa334b 100644 --- a/src/main/java/tconstruct/items/tools/LumberAxe.java +++ b/src/main/java/tconstruct/items/tools/LumberAxe.java @@ -57,7 +57,7 @@ public class LumberAxe extends HarvestTool public boolean onBlockDestroyed (ItemStack itemstack, World world, int bID, int x, int y, int z, EntityLivingBase player) { Block block = Block.blocksList[bID]; - if (block != null && block.blockMaterial == Material.leaves) + if (block != null && block.func_149688_o() == Material.leaves) return false; return AbilityHelper.onBlockChanged(itemstack, world, bID, x, y, z, player, random); @@ -95,7 +95,7 @@ public class LumberAxe extends HarvestTool Material[] materials = getEffectiveMaterials(); for (int i = 0; i < materials.length; i++) { - if (materials[i] == block.blockMaterial) + if (materials[i] == block.func_149688_o()) { float mineSpeed = tags.getInteger("MiningSpeed"); int heads = 1; @@ -145,7 +145,7 @@ public class LumberAxe extends HarvestTool { return super.onBlockStartBreak(stack, x, y, z, player); } - if (wood.isWood(world, x, y, z) || wood.blockMaterial == Material.sponge) + if (wood.isWood(world, x, y, z) || wood.func_149688_o() == Material.sponge) { int height = y; boolean foundTop = false; @@ -187,7 +187,7 @@ public class LumberAxe extends HarvestTool if (!world.isRemote) world.playAuxSFX(2001, x, y, z, woodID + (meta << 12)); } - else if (wood.blockMaterial == Material.wood) + else if (wood.func_149688_o() == Material.wood) { NBTTagCompound tags = stack.getTagCompound().getCompoundTag("InfiTool"); int meta = world.getBlockMetadata(x, y, z); @@ -292,7 +292,7 @@ public class LumberAxe extends HarvestTool int meta = world.getBlockMetadata(xPos, yPos, zPos); int hlvl = MinecraftForge.getBlockHarvestLevel(block, meta, getHarvestType()); - if (block != null && block.blockMaterial == Material.wood) + if (block != null && block.func_149688_o() == Material.wood) { if (hlvl <= tags.getInteger("HarvestLevel")) { diff --git a/src/main/java/tconstruct/items/tools/Scythe.java b/src/main/java/tconstruct/items/tools/Scythe.java index fccdf5c9..7ef163dc 100644 --- a/src/main/java/tconstruct/items/tools/Scythe.java +++ b/src/main/java/tconstruct/items/tools/Scythe.java @@ -179,11 +179,11 @@ public class Scythe extends Weapon { int localblockID = world.getBlockId(xPos, yPos, zPos); Block block = Block.blocksList[localblockID]; - if (block != null)// && (block.blockMaterial == Material.leaves || block.isLeaves(world, xPos, yPos, zPos))) + if (block != null)// && (block.func_149688_o() == Material.leaves || block.isLeaves(world, xPos, yPos, zPos))) { for (int iter = 0; iter < materials.length; iter++) { - if (materials[iter] == block.blockMaterial) + if (materials[iter] == block.func_149688_o()) { int localMeta = world.getBlockMetadata(xPos, yPos, zPos); world.setBlockToAir(xPos, yPos, zPos); diff --git a/src/main/java/tconstruct/library/tools/AbilityHelper.java b/src/main/java/tconstruct/library/tools/AbilityHelper.java index 26c6639d..ac6d9046 100644 --- a/src/main/java/tconstruct/library/tools/AbilityHelper.java +++ b/src/main/java/tconstruct/library/tools/AbilityHelper.java @@ -43,7 +43,7 @@ public class AbilityHelper public static boolean necroticUHS; /* Normal interactions */ - public static boolean onBlockChanged (ItemStack stack, World world, int bID, int x, int y, int z, EntityLivingBase player, Random random) + public static boolean onBlockChanged (ItemStack stack, World world, Block block, int x, int y, int z, EntityLivingBase player, Random random) { if (!stack.hasTagCompound()) return false; @@ -260,7 +260,7 @@ public class AbilityHelper } else { - Item.itemsList[stack.itemID].hitEntity(stack, (EntityLivingBase) entity, player); + stack.getItem().hitEntity(stack, (EntityLivingBase) entity, player); } if ((fireAspect > 0 || toolTags.hasKey("Fiery") || toolTags.hasKey("Lava")) && causedDamage) @@ -300,7 +300,7 @@ public class AbilityHelper { EntityWolf var3 = (EntityWolf) living; - if (var3.isTamed() && player.username.equals(var3.getOwnerName())) + if (var3.isTamed() && player.getDisplayName().equals(var3.getOwnerName())) { return; } @@ -316,7 +316,7 @@ public class AbilityHelper { EntityWolf var5 = (EntityWolf) var4.next(); - if (var5.isTamed() && var5.getEntityToAttack() == null && player.username.equals(var5.getOwnerName()) && (!par2 || !var5.isSitting())) + if (var5.isTamed() && var5.getEntityToAttack() == null && player.getDisplayName().equals(var5.getOwnerName()) && (!par2 || !var5.isSitting())) { var5.setSitting(false); var5.setTarget(living); @@ -495,8 +495,8 @@ public class AbilityHelper return true; } - Block b = world.getBlockId(x, y, z); - Block babove = world.getBlockId(x, y + 1, z); + Block b = world.func_147439_a(x, y, z); + Block babove = world.func_147439_a(x, y + 1, z); if ((side == 0 || babove != Blocks.air || b != Blocks.grass) && b != Blocks.dirt) { diff --git a/src/main/java/tconstruct/library/tools/DualHarvestTool.java b/src/main/java/tconstruct/library/tools/DualHarvestTool.java index 8dd599f7..9df9e644 100644 --- a/src/main/java/tconstruct/library/tools/DualHarvestTool.java +++ b/src/main/java/tconstruct/library/tools/DualHarvestTool.java @@ -65,7 +65,7 @@ public abstract class DualHarvestTool extends HarvestTool Material[] materials = getEffectiveMaterials(); for (int i = 0; i < materials.length; i++) { - if (materials[i] == block.blockMaterial) + if (materials[i] == block.func_149688_o()) { float speed = tags.getInteger("MiningSpeed"); speed /= 100f; @@ -83,7 +83,7 @@ public abstract class DualHarvestTool extends HarvestTool materials = getEffectiveSecondaryMaterials(); for (int i = 0; i < materials.length; i++) { - if (materials[i] == block.blockMaterial) + if (materials[i] == block.func_149688_o()) { float speed = tags.getInteger("MiningSpeed2"); speed /= 100f; @@ -103,18 +103,18 @@ public abstract class DualHarvestTool extends HarvestTool public boolean canHarvestBlock (Block block) { - if (block.blockMaterial.isToolNotRequired()) + if (block.func_149688_o().isToolNotRequired()) { return true; } for (Material m : getEffectiveMaterials()) { - if (m == block.blockMaterial) + if (m == block.func_149688_o()) return true; } for (Material m : getEffectiveSecondaryMaterials()) { - if (m == block.blockMaterial) + if (m == block.func_149688_o()) return true; } return false; diff --git a/src/main/java/tconstruct/library/tools/HarvestTool.java b/src/main/java/tconstruct/library/tools/HarvestTool.java index dd05a08b..82267779 100644 --- a/src/main/java/tconstruct/library/tools/HarvestTool.java +++ b/src/main/java/tconstruct/library/tools/HarvestTool.java @@ -69,7 +69,7 @@ public abstract class HarvestTool extends ToolCore Material[] materials = getEffectiveMaterials(); for (int i = 0; i < materials.length; i++) { - if (materials[i] == block.blockMaterial) + if (materials[i] == block.func_149688_o()) { return calculateStrength(tags, block, meta); } @@ -117,13 +117,13 @@ public abstract class HarvestTool extends ToolCore public boolean canHarvestBlock (Block block) { - if (block.blockMaterial.isToolNotRequired()) + if (block.func_149688_o().isToolNotRequired()) { return true; } for (Material m : getEffectiveMaterials()) { - if (m == block.blockMaterial) + if (m == block.func_149688_o()) return true; } return false; diff --git a/src/main/java/tconstruct/library/tools/ToolCore.java b/src/main/java/tconstruct/library/tools/ToolCore.java index 3b35d67e..cafd93cf 100644 --- a/src/main/java/tconstruct/library/tools/ToolCore.java +++ b/src/main/java/tconstruct/library/tools/ToolCore.java @@ -611,12 +611,11 @@ public abstract class ToolCore extends Item implements IEnergyContainerItem, IBa } @Override - public boolean onBlockDestroyed (ItemStack itemstack, World world, int blockID, int x, int y, int z, EntityLivingBase player) + public boolean onBlockDestroyed (ItemStack itemstack, World world, Block block, int x, int y, int z, EntityLivingBase player) { - Block block = Block.blocksList[blockID]; if (block != null && (double) block.getBlockHardness(world, x, y, z) != 0.0D) { - return AbilityHelper.onBlockChanged(itemstack, world, blockID, x, y, z, player, random); + return AbilityHelper.onBlockChanged(itemstack, world, block, x, y, z, player, random); } return true; } diff --git a/src/main/java/tconstruct/library/tools/Weapon.java b/src/main/java/tconstruct/library/tools/Weapon.java index 31001ea1..1ed43e23 100644 --- a/src/main/java/tconstruct/library/tools/Weapon.java +++ b/src/main/java/tconstruct/library/tools/Weapon.java @@ -37,7 +37,7 @@ public abstract class Weapon extends ToolCore for (int i = 0; i < web.length; i++) { - if (web[i] == block.blockMaterial) + if (web[i] == block.func_149688_o()) { return effectiveSpeed(); } @@ -82,7 +82,7 @@ public abstract class Weapon extends ToolCore { for (int i = 0; i < web.length; i++) { - if (block.blockMaterial == web[i]) + if (block.func_149688_o() == web[i]) return true; } return super.canHarvestBlock(block); diff --git a/src/main/java/tconstruct/util/TEventHandler.java b/src/main/java/tconstruct/util/TEventHandler.java index e430bb43..65169469 100644 --- a/src/main/java/tconstruct/util/TEventHandler.java +++ b/src/main/java/tconstruct/util/TEventHandler.java @@ -12,7 +12,7 @@ import net.minecraft.block.Block; import net.minecraft.entity.Entity; import net.minecraft.entity.EntityLiving; import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.EntityLivingData; +import net.minecraft.entity.IEntityLivingData; import net.minecraft.entity.boss.EntityWither; import net.minecraft.entity.item.EntityItem; import net.minecraft.entity.item.EntityXPOrb; @@ -401,7 +401,7 @@ public class TEventHandler { for (EntityItem o : event.drops) { - if (o.getEntityItem().itemID == Items.ghast_tear) + if (o.getEntityItem().getItem() == Items.ghast_tear) { o.setEntityItemStack(new ItemStack(Items.gold_ingot, 1)); } @@ -422,7 +422,7 @@ public class TEventHandler { ItemStack dropStack = new ItemStack(Items.skull, 1, 3); NBTTagCompound nametag = new NBTTagCompound(); - nametag.setString("SkullOwner", player.username); + nametag.setString("SkullOwner", player.getDisplayName()); addDrops(event, dropStack); } @@ -439,7 +439,7 @@ public class TEventHandler { ItemStack dropStack = new ItemStack(Items.skull, 1, 3); NBTTagCompound nametag = new NBTTagCompound(); - nametag.setString("SkullOwner", player.username); + nametag.setString("SkullOwner", player.getDisplayName()); addDrops(event, dropStack); } } @@ -448,7 +448,7 @@ public class TEventHandler GameRules rules = player.worldObj.getGameRules(); //Player is null if this crashes if (rules == null || !rules.getGameRuleBooleanValue("keepInventory")) { - TPlayerStats stats = TConstruct.playerTracker.getPlayerStats(player.username); + TPlayerStats stats = TConstruct.playerTracker.getPlayerStats(player.getDisplayName()); if (stats != null) { stats.armor.dropItems(); @@ -512,7 +512,7 @@ public class TEventHandler if (!world.isRemote) { entity.setPosition(x, y, z); - entity.onSpawnWithEgg((EntityLivingData) null); + entity.onSpawnWithEgg((IEntityLivingData) null); world.spawnEntityInWorld(entity); } } @@ -524,7 +524,7 @@ public class TEventHandler { if (!event.world.isRemote) { - if (event.ID == TRepo.slimeSapling.blockID) + if (event.block == TRepo.slimeSapling) { if (TRepo.slimeSapling.boneFertilize(event.world, event.X, event.Y, event.Z, event.world.rand, event.entityPlayer)) event.setResult(Event.Result.ALLOW); @@ -562,10 +562,10 @@ public class TEventHandler return; } - int bID = evt.world.getBlockId(hitX, hitY, hitZ); + Block bID = evt.world.func_147439_a(hitX, hitY, hitZ); for (int id = 0; id < TRepo.fluidBlocks.length; id++) { - if (bID == TRepo.fluidBlocks[id].blockID) + if (bID == TRepo.fluidBlocks[id]) { if (evt.entityPlayer.capabilities.isCreativeMode) { @@ -630,7 +630,7 @@ public class TEventHandler { if(event.entityLiving instanceof EntityPlayer){ EntityPlayer player = (EntityPlayer) event.entityLiving; - TPlayerStats stats = TConstruct.playerTracker.getPlayerStats(player.username); + TPlayerStats stats = TConstruct.playerTracker.getPlayerStats(player.getDisplayName()); if(stats != null){ ArmorExtended armor = stats.armor; @@ -650,7 +650,7 @@ public class TEventHandler { if (event.action == Action.LEFT_CLICK_BLOCK) { - Block block = Block.blocksList[event.entity.worldObj.getBlockId(event.x, event.y, event.z)]; + Block block = event.entity.worldObj.func_147439_a(event.x, event.y, event.z); if (block instanceof TankAirBlock) { event.setCanceled(true); diff --git a/src/main/java/tconstruct/worldgen/TBaseWorldGenerator.java b/src/main/java/tconstruct/worldgen/TBaseWorldGenerator.java index b00f300d..ca603d69 100644 --- a/src/main/java/tconstruct/worldgen/TBaseWorldGenerator.java +++ b/src/main/java/tconstruct/worldgen/TBaseWorldGenerator.java @@ -275,15 +275,15 @@ public class TBaseWorldGenerator implements IWorldGenerator Block block = Block.blocksList[blockID]; if (block != null) { - if (block.blockMaterial == Material.leaves) + if (block.func_149688_o() == Material.leaves) world.setBlock(x + chunkX, y, z + chunkZ, Blocks.lava, 0, 0); - if (block.blockMaterial == Material.wood) + if (block.func_149688_o() == Material.wood) world.setBlock(x + chunkX, y, z + chunkZ, Blocks.netherrack, 0, 0); if (block == Blocks.stone) world.setBlock(x + chunkX, y, z + chunkZ, Blocks.end_stone, 0, 0); - if (y > 40 && (block.blockMaterial == Material.ground || block.blockMaterial == Material.grass)) + if (y > 40 && (block.func_149688_o() == Material.ground || block.func_149688_o() == Material.grass)) world.setBlock(x + chunkX, y, z + chunkZ, Blocks.soul_sand, 0, 0); - if (block.blockMaterial == Material.sand) + if (block.func_149688_o() == Material.sand) world.setBlock(x + chunkX, y, z + chunkZ, Block.silverfish, 0, 0); } }