From e71d03c375609175bdcf8d6830e0064a1c97f140 Mon Sep 17 00:00:00 2001 From: reidbhuntley Date: Sun, 20 Jun 2021 01:55:08 -0400 Subject: [PATCH] Fix Deployer inventory-voiding bug - Deployers' inventories will no longer be voided when their contraption is disassembled and reassembled before the DeployerTileEntity can initialize --- .../contraptions/components/deployer/DeployerTileEntity.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/simibubi/create/content/contraptions/components/deployer/DeployerTileEntity.java b/src/main/java/com/simibubi/create/content/contraptions/components/deployer/DeployerTileEntity.java index 486de2d0e..6a21a0127 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/components/deployer/DeployerTileEntity.java +++ b/src/main/java/com/simibubi/create/content/contraptions/components/deployer/DeployerTileEntity.java @@ -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);