From 3de7766db6f1004aac4224ea8c160fd5249bac89 Mon Sep 17 00:00:00 2001 From: mezz Date: Wed, 4 Mar 2015 22:48:07 -0800 Subject: [PATCH] Fix #532 Fix WAILA support. Use the deprecated getPickBlock --- .../arboriculture/gadgets/BlockArbStairs.java | 4 ++-- .../arboriculture/gadgets/BlockSapling.java | 2 +- .../arboriculture/gadgets/ForestryBlockLeaves.java | 5 ++--- .../arboriculture/items/ItemLeavesBlock.java | 14 ++++---------- .../java/forestry/farming/gadgets/BlockFarm.java | 4 ++-- 5 files changed, 11 insertions(+), 18 deletions(-) diff --git a/src/main/java/forestry/arboriculture/gadgets/BlockArbStairs.java b/src/main/java/forestry/arboriculture/gadgets/BlockArbStairs.java index d1a33e0cc..225833ab2 100755 --- a/src/main/java/forestry/arboriculture/gadgets/BlockArbStairs.java +++ b/src/main/java/forestry/arboriculture/gadgets/BlockArbStairs.java @@ -111,8 +111,8 @@ public class BlockArbStairs extends BlockStairs { } @Override - public ItemStack getPickBlock(MovingObjectPosition target, World world, int x, int y, int z, EntityPlayer player) { - ItemStack itemStack = super.getPickBlock(target, world, x, y, z, player); + public ItemStack getPickBlock(MovingObjectPosition target, World world, int x, int y, int z) { + ItemStack itemStack = super.getPickBlock(target, world, x, y, z); NBTTagCompound stairsNBT = getTagCompoundForStairs(world, x, y, z); itemStack.setTagCompound(stairsNBT); return itemStack; diff --git a/src/main/java/forestry/arboriculture/gadgets/BlockSapling.java b/src/main/java/forestry/arboriculture/gadgets/BlockSapling.java index ca908bc9b..336358350 100755 --- a/src/main/java/forestry/arboriculture/gadgets/BlockSapling.java +++ b/src/main/java/forestry/arboriculture/gadgets/BlockSapling.java @@ -155,7 +155,7 @@ public class BlockSapling extends BlockTreeContainer { } @Override - public ItemStack getPickBlock(MovingObjectPosition target, World world, int x, int y, int z, EntityPlayer player) { + public ItemStack getPickBlock(MovingObjectPosition target, World world, int x, int y, int z) { TileSapling sapling = getSaplingTile(world, x, y, z); if (sapling == null || sapling.getTree() == null) { return null; diff --git a/src/main/java/forestry/arboriculture/gadgets/ForestryBlockLeaves.java b/src/main/java/forestry/arboriculture/gadgets/ForestryBlockLeaves.java index eaccf65cf..8d13d3fd9 100644 --- a/src/main/java/forestry/arboriculture/gadgets/ForestryBlockLeaves.java +++ b/src/main/java/forestry/arboriculture/gadgets/ForestryBlockLeaves.java @@ -165,9 +165,8 @@ public class ForestryBlockLeaves extends BlockNewLeaf implements ITileEntityProv } @Override - public ItemStack getPickBlock(MovingObjectPosition target, World world, int x, int y, int z, EntityPlayer player) { - - ItemStack itemStack = super.getPickBlock(target, world, x, y, z, player); + public ItemStack getPickBlock(MovingObjectPosition target, World world, int x, int y, int z) { + ItemStack itemStack = super.getPickBlock(target, world, x, y, z); NBTTagCompound treeNBT = getTagCompoundForTree(world, x, y, z); itemStack.setTagCompound(treeNBT); return itemStack; diff --git a/src/main/java/forestry/arboriculture/items/ItemLeavesBlock.java b/src/main/java/forestry/arboriculture/items/ItemLeavesBlock.java index 5ee4ac5cd..99020e820 100644 --- a/src/main/java/forestry/arboriculture/items/ItemLeavesBlock.java +++ b/src/main/java/forestry/arboriculture/items/ItemLeavesBlock.java @@ -41,27 +41,21 @@ public class ItemLeavesBlock extends ItemForestryBlock { return PluginArboriculture.proxy.getFoliageColorBasic(); } ITree tree = getTree(itemstack); - if (tree == null) { - return PluginArboriculture.proxy.getFoliageColorBasic(); - } return tree.getGenome().getPrimary().getLeafColour(tree); } - private ITree getTree(ItemStack itemStack) { - return new Tree(itemStack.getTagCompound()); - } - @Override public boolean placeBlockAt(ItemStack stack, EntityPlayer player, World world, int x, int y, int z, int side, float hitX, float hitY, float hitZ, int metadata) { if (!stack.hasTagCompound()) { return false; } ITree tree = getTree(stack); - if (tree == null) { - return false; - } GameProfile owner = player.getGameProfile(); return PluginArboriculture.treeInterface.setLeaves(world, tree, owner, x, y, z, true); } + private ITree getTree(ItemStack itemStack) { + return new Tree(itemStack.getTagCompound()); + } + } diff --git a/src/main/java/forestry/farming/gadgets/BlockFarm.java b/src/main/java/forestry/farming/gadgets/BlockFarm.java index 4ee20309e..c88525177 100755 --- a/src/main/java/forestry/farming/gadgets/BlockFarm.java +++ b/src/main/java/forestry/farming/gadgets/BlockFarm.java @@ -69,10 +69,10 @@ public class BlockFarm extends BlockStructure { } @Override - public ItemStack getPickBlock(MovingObjectPosition target, World world, int x, int y, int z, EntityPlayer player) { + public ItemStack getPickBlock(MovingObjectPosition target, World world, int x, int y, int z) { ArrayList drops = getDrops(world, x, y, z, 0, 0); if (drops.isEmpty()) { - return super.getPickBlock(target, world, x, y, z, player); + return super.getPickBlock(target, world, x, y, z); } return drops.get(0); }