fix entity interaction dupebug, clean up shears logic
This commit is contained in:
parent
964cfd271f
commit
02477afb99
2 changed files with 8 additions and 2 deletions
|
@ -69,6 +69,8 @@ public class StripesHandlerEntityInteract implements IStripesHandler {
|
|||
activator.sendItem(stack, direction.getOpposite());
|
||||
}
|
||||
|
||||
player.setCurrentItemOrArmor(0, null);
|
||||
|
||||
return successful;
|
||||
}
|
||||
|
||||
|
|
|
@ -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);
|
||||
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());
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue