Fix #532 Fix WAILA support. Use the deprecated getPickBlock

This commit is contained in:
mezz committed 2015-03-04 22:48:07 -08:00
1 parent 671752d1cf
commit 3de7766db6
5 files changed
+11 -18

No files matched your search

@@ -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;
@@ -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;
@@ -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;
@@ -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());
}
}
@@ -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<ItemStack> 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);
}