Fix issue with providing a null ItemStack to onPlayerDestroyItem (#6633)

This commit is contained in:
Jacob Smith authored and GitHub committed 2020-05-03 13:48:17 -07:00
1 parent 9e763a8334
commit c3e4d303e9
1 file changed
+1 -1
@@ -606,7 +606,7 @@ public class ForgeHooks
if (!(itemstack.getItem() instanceof BucketItem)) // if not bucket
world.captureBlockSnapshots = true;
ItemStack copy = itemstack.isDamageable() ? itemstack.copy() : null;
ItemStack copy = itemstack.copy();
ActionResultType ret = itemstack.getItem().onItemUse(context);
if (itemstack.isEmpty())
ForgeEventFactory.onPlayerDestroyItem(player, copy, context.getHand());