Fix duplication by 0 size itemstacks

This commit is contained in:
Sam 2017-12-07 15:45:58 +00:00 committed by Alexander Meech
parent 8a856326cb
commit 77c7362c35
1 changed files with 11 additions and 0 deletions

View File

@ -239,6 +239,17 @@ public class CakePlayerModule extends CakeModule
_game.getArcadeManager().runSyncLater(() ->
{
PlayerInventory inventory = player.getInventory();
ItemStack[] contents = storedInventory[0];
for (int i = 0; i < contents.length; i++)
{
ItemStack itemStack = contents[i];
if (itemStack.getAmount() < 1)
{
contents[i] = null;
}
}
inventory.setContents(storedInventory[0]);
inventory.setArmorContents(storedInventory[1]);