From a3060ae8e0c3a20354440b6dd537d0a129c2fad3 Mon Sep 17 00:00:00 2001 From: SoundLogic Date: Wed, 13 Aug 2014 03:15:01 -0500 Subject: [PATCH] Fixed stupid errors and improved readability --- src/main/java/biomesoplenty/common/items/ItemBOPFood.java | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/main/java/biomesoplenty/common/items/ItemBOPFood.java b/src/main/java/biomesoplenty/common/items/ItemBOPFood.java index 243c923e5..aea812bb2 100644 --- a/src/main/java/biomesoplenty/common/items/ItemBOPFood.java +++ b/src/main/java/biomesoplenty/common/items/ItemBOPFood.java @@ -61,16 +61,20 @@ public class ItemBOPFood extends ItemFood public boolean onItemUse(ItemStack stack, EntityPlayer player, World world, int x, int y, int z, int side, float hitVecX, float hitVecY, float hitVecZ) { + if (stack.getItemDamage() != 2) + { + return false; + } if (side != 1) { return false; } else if (player.canPlayerEdit(x, y, z, side, stack) && player.canPlayerEdit(x, y + 1, z, side, stack)) { - if (((BlockBOPPlant)BOPCBlocks.plants).isValidPosition(world, x, y+1, z, 11) && world.isAirBlock(x, y + 1, z)) + if (((BlockBOPPlant)BOPCBlocks.plants).isValidPosition(world, x, y + 1, z, 11) && world.isAirBlock(x, y + 1, z)) { world.setBlock(x, y + 1, z, BOPCBlocks.plants); - world.setBlockMetadataWithNotify(x, y+1, z, 11, 2); + world.setBlockMetadataWithNotify(x, y + 1, z, 11, 2); --stack.stackSize; return true; }