Serialize plate press container
This commit is contained in:
parent
5c87d0f8ab
commit
59ff6c4a2e
@ -36,6 +36,16 @@ class BlockEntityPlatePress(p_155229_: BlockPos, p_155230_: BlockState) : BlockE
|
|||||||
energy = MatteryMachineEnergyStorage(this::setChangedLight, MatteryMachineEnergyStorage.MachineType.WORKER)
|
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 getDefaultDisplayName() = NAME
|
||||||
|
|
||||||
override fun createMenu(containerID: Int, inventory: Inventory, ply: Player): AbstractContainerMenu {
|
override fun createMenu(containerID: Int, inventory: Inventory, ply: Player): AbstractContainerMenu {
|
||||||
|
Loading…
Reference in New Issue
Block a user