From 59ff6c4a2e026460ba8ede6b177799d230f306d8 Mon Sep 17 00:00:00 2001 From: DBotThePony Date: Fri, 14 Jan 2022 17:43:20 +0700 Subject: [PATCH] Serialize plate press container --- .../mc/otm/block/entity/BlockEntityPlatePress.kt | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/BlockEntityPlatePress.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/BlockEntityPlatePress.kt index 83f96438f..4de5507d5 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/BlockEntityPlatePress.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/BlockEntityPlatePress.kt @@ -36,6 +36,16 @@ class BlockEntityPlatePress(p_155229_: BlockPos, p_155230_: BlockState) : BlockE energy = MatteryMachineEnergyStorage(this::setChangedLight, MatteryMachineEnergyStorage.MachineType.WORKER) } + override fun saveAdditional(nbt: CompoundTag) { + super.saveAdditional(nbt) + nbt["container"] = container.serializeNBT() + } + + override fun load(nbt: CompoundTag) { + super.load(nbt) + container.deserializeNBT(nbt["container"]) + } + override fun getDefaultDisplayName() = NAME override fun createMenu(containerID: Int, inventory: Inventory, ply: Player): AbstractContainerMenu {