From 02477afb99ee0cacb8a23020e4ba29f63a196551 Mon Sep 17 00:00:00 2001 From: Adrian Date: Sun, 17 May 2015 11:47:01 +0200 Subject: [PATCH] fix entity interaction dupebug, clean up shears logic --- .../transport/stripes/StripesHandlerEntityInteract.java | 2 ++ .../transport/stripes/StripesHandlerShears.java | 8 ++++++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/common/buildcraft/transport/stripes/StripesHandlerEntityInteract.java b/common/buildcraft/transport/stripes/StripesHandlerEntityInteract.java index fa9a8549..804cab4e 100644 --- a/common/buildcraft/transport/stripes/StripesHandlerEntityInteract.java +++ b/common/buildcraft/transport/stripes/StripesHandlerEntityInteract.java @@ -69,6 +69,8 @@ public class StripesHandlerEntityInteract implements IStripesHandler { activator.sendItem(stack, direction.getOpposite()); } + player.setCurrentItemOrArmor(0, null); + return successful; } diff --git a/common/buildcraft/transport/stripes/StripesHandlerShears.java b/common/buildcraft/transport/stripes/StripesHandlerShears.java index 05bd2651..073a4b63 100644 --- a/common/buildcraft/transport/stripes/StripesHandlerShears.java +++ b/common/buildcraft/transport/stripes/StripesHandlerShears.java @@ -40,8 +40,12 @@ public class StripesHandlerShears implements IStripesHandler { List drops = shearableBlock.onSheared(stack, world, x, y, z, EnchantmentHelper.getEnchantmentLevel(Enchantment.fortune.effectId, stack)); world.setBlockToAir(x, y, z); - stack.damageItem(1, player); - activator.sendItem(stack, direction.getOpposite()); + if (stack.attemptDamageItem(1, player.getRNG())) { + stack.stackSize--; + } + if (stack.stackSize > 0) { + activator.sendItem(stack, direction.getOpposite()); + } for (ItemStack dropStack : drops) { activator.sendItem(dropStack, direction.getOpposite()); }