Fix duplication by 0 size itemstacks
This commit is contained in:
parent
8a856326cb
commit
77c7362c35
@ -239,6 +239,17 @@ public class CakePlayerModule extends CakeModule
|
|||||||
_game.getArcadeManager().runSyncLater(() ->
|
_game.getArcadeManager().runSyncLater(() ->
|
||||||
{
|
{
|
||||||
PlayerInventory inventory = player.getInventory();
|
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.setContents(storedInventory[0]);
|
||||||
inventory.setArmorContents(storedInventory[1]);
|
inventory.setArmorContents(storedInventory[1]);
|
||||||
|
Loading…
Reference in New Issue
Block a user