Fix issue with providing a null ItemStack to onPlayerDestroyItem (#6633)
This commit is contained in:
parent
9e763a8334
commit
c3e4d303e9
1 changed files with 1 additions and 1 deletions
|
@ -606,7 +606,7 @@ public class ForgeHooks
|
||||||
if (!(itemstack.getItem() instanceof BucketItem)) // if not bucket
|
if (!(itemstack.getItem() instanceof BucketItem)) // if not bucket
|
||||||
world.captureBlockSnapshots = true;
|
world.captureBlockSnapshots = true;
|
||||||
|
|
||||||
ItemStack copy = itemstack.isDamageable() ? itemstack.copy() : null;
|
ItemStack copy = itemstack.copy();
|
||||||
ActionResultType ret = itemstack.getItem().onItemUse(context);
|
ActionResultType ret = itemstack.getItem().onItemUse(context);
|
||||||
if (itemstack.isEmpty())
|
if (itemstack.isEmpty())
|
||||||
ForgeEventFactory.onPlayerDestroyItem(player, copy, context.getHand());
|
ForgeEventFactory.onPlayerDestroyItem(player, copy, context.getHand());
|
||||||
|
|
Loading…
Reference in a new issue