Fix Deployer inventory-voiding bug

- Deployers' inventories will no longer be voided when their contraption is disassembled and reassembled before the DeployerTileEntity can initialize
This commit is contained in:
reidbhuntley 2021-06-20 01:55:08 -04:00
parent 6d177c4366
commit e71d03c375

View file

@ -327,12 +327,13 @@ public class DeployerTileEntity extends KineticTileEntity {
compound.putBoolean("Powered", redstoneLocked);
if (player != null) {
compound.put("HeldItem", player.getHeldItemMainhand()
.serializeNBT());
ListNBT invNBT = new ListNBT();
player.inventory.write(invNBT);
compound.put("Inventory", invNBT);
compound.put("HeldItem", player.getHeldItemMainhand().serializeNBT());
compound.put("Overflow", NBTHelper.writeItemList(overflowItems));
} else if (deferredInventoryList != null) {
compound.put("Inventory", deferredInventoryList);
}
super.write(compound, clientPacket);