fix entity interaction dupebug, clean up shears logic

This commit is contained in:
Adrian 2015-05-17 11:47:01 +02:00
parent 964cfd271f
commit 02477afb99
2 changed files with 8 additions and 2 deletions

View file

@ -69,6 +69,8 @@ public class StripesHandlerEntityInteract implements IStripesHandler {
activator.sendItem(stack, direction.getOpposite());
}
player.setCurrentItemOrArmor(0, null);
return successful;
}

View file

@ -40,8 +40,12 @@ public class StripesHandlerShears implements IStripesHandler {
List<ItemStack> 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());
}