mirror of
https://github.com/MinecraftForge/MinecraftForge.git
synced 2026-11-18 11:29:15 +00:00
Fix issue with providing a null ItemStack to onPlayerDestroyItem (#6633)
This commit is contained in:
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());
|
||||
|
||||
Reference in new issue
Block a user