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

This commit is contained in:
Jacob Smith 2020-05-03 13:48:17 -07:00 committed by GitHub
parent 9e763a8334
commit c3e4d303e9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -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());