Fix item used stat not triggering properly on last item in the stack.
This commit is contained in:
parent
2c8c022034
commit
4dc34b7d5b
1 changed files with 2 additions and 5 deletions
|
@ -589,17 +589,14 @@ public class ForgeHooks
|
|||
return ActionResultType.PASS;
|
||||
|
||||
// handle all placement events here
|
||||
Item item = itemstack.getItem();
|
||||
int size = itemstack.getCount();
|
||||
CompoundNBT nbt = null;
|
||||
if (itemstack.getTag() != null)
|
||||
{
|
||||
nbt = itemstack.getTag().copy();
|
||||
}
|
||||
|
||||
if (!(itemstack.getItem() instanceof BucketItem)) // if not bucket
|
||||
{
|
||||
world.captureBlockSnapshots = true;
|
||||
}
|
||||
|
||||
ItemStack copy = itemstack.isDamageable() ? itemstack.copy() : null;
|
||||
ActionResultType ret = itemstack.getItem().onItemUse(context);
|
||||
|
@ -666,7 +663,7 @@ public class ForgeHooks
|
|||
|
||||
world.markAndNotifyBlock(snap.getPos(), null, oldBlock, newBlock, updateFlag);
|
||||
}
|
||||
player.addStat(Stats.ITEM_USED.get(itemstack.getItem()));
|
||||
player.addStat(Stats.ITEM_USED.get(item));
|
||||
}
|
||||
}
|
||||
world.capturedBlockSnapshots.clear();
|
||||
|
|
Loading…
Reference in a new issue