diff --git a/RebornCore/src/main/java/reborncore/common/util/RebornInventory.java b/RebornCore/src/main/java/reborncore/common/util/RebornInventory.java index 522d90a98..f56d4c4b3 100644 --- a/RebornCore/src/main/java/reborncore/common/util/RebornInventory.java +++ b/RebornCore/src/main/java/reborncore/common/util/RebornInventory.java @@ -141,6 +141,7 @@ public class RebornInventory extends Inventory public void setHashChanged() { this.hasChanged = true; + this.markDirty(); } public void setHashChanged(boolean changed) { diff --git a/src/main/java/techreborn/blockentity/storage/item/StorageUnitBaseBlockEntity.java b/src/main/java/techreborn/blockentity/storage/item/StorageUnitBaseBlockEntity.java index b3f9d478a..0bcf4da15 100644 --- a/src/main/java/techreborn/blockentity/storage/item/StorageUnitBaseBlockEntity.java +++ b/src/main/java/techreborn/blockentity/storage/item/StorageUnitBaseBlockEntity.java @@ -75,23 +75,21 @@ public class StorageUnitBaseBlockEntity extends MachineBaseBlockEntity implement public StorageUnitBaseBlockEntity(BlockPos pos, BlockState state) { super(TRBlockEntities.STORAGE_UNIT, pos, state); + inventory = new RebornInventory<>(2, "ItemInventory", 64, this); } public StorageUnitBaseBlockEntity(BlockPos pos, BlockState state, TRContent.StorageUnit type) { super(TRBlockEntities.STORAGE_UNIT, pos, state); + inventory = new RebornInventory<>(2, "ItemInventory", 64, this); configureEntity(type); } private void configureEntity(TRContent.StorageUnit type) { - // Set capacity to local config unless overridden by server if(serverCapacity == -1){ this.maxCapacity = type.capacity; } - storeItemStack = ItemStack.EMPTY; - inventory = new RebornInventory<>(2, "ItemInventory", 64, this); - this.type = type; } @@ -313,8 +311,6 @@ public class StorageUnitBaseBlockEntity extends MachineBaseBlockEntity implement if (tagCompound.contains("lockedItem")) { lockedItemStack = ItemStack.fromNbt(tagCompound.getCompound("lockedItem")); } - - inventory.read(tagCompound); } @Override @@ -340,8 +336,6 @@ public class StorageUnitBaseBlockEntity extends MachineBaseBlockEntity implement if (isLocked()) { tagCompound.put("lockedItem", lockedItemStack.writeNbt(new NbtCompound())); } - - inventory.write(tagCompound); } @Override