specify inventory changes
This commit is contained in:
1 parent
a0bd6e22ac
commit
289df9d9f8
4 files changed
+21
-12
No files matched your search
@@ -27,10 +27,11 @@ public abstract class Inventory_scarpetEventMixin
|
||||
if (!PLAYER_PICKS_UP_ITEM.isNeeded() || !(player instanceof ServerPlayer))
|
||||
return playerInventory.add(-1, stack);
|
||||
int count = stack.getCount();
|
||||
ItemStack previous = stack.copy();
|
||||
boolean res = playerInventory.add(-1, stack);
|
||||
if (count != stack.getCount()) // res returns false for larger item adding to a almost full ineventory
|
||||
{
|
||||
ItemStack diffStack = stack.copyWithCount(count - stack.getCount());
|
||||
ItemStack diffStack = previous.copyWithCount(count - stack.getCount());
|
||||
PLAYER_PICKS_UP_ITEM.onItemAction((ServerPlayer) player, null, diffStack);
|
||||
}
|
||||
return res;
|
||||
|
||||
Reference in new issue
Block a user