diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/matter/MatterBottlerBlockEntity.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/matter/MatterBottlerBlockEntity.kt index e9fe053a1..3bf343fd6 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/matter/MatterBottlerBlockEntity.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/matter/MatterBottlerBlockEntity.kt @@ -106,7 +106,7 @@ class MatterBottlerBlockEntity(blockPos: BlockPos, blockState: BlockState) : savetables.stateful(::matter, MATTER_STORAGE_KEY) savetables.stateful(::bottling) savetables.stateful(::unbottling) - savetables.stateful(::upgrades) + savetables.stateful(upgrades::container, "upgrades") } var workProgress: Float = 0f diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/matter/MatterDecomposerBlockEntity.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/matter/MatterDecomposerBlockEntity.kt index 8a7836f9e..bb70e2ca1 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/matter/MatterDecomposerBlockEntity.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/matter/MatterDecomposerBlockEntity.kt @@ -64,7 +64,7 @@ class MatterDecomposerBlockEntity(pos: BlockPos, state: BlockState) init { savetables.stateful(::energy, ENERGY_KEY) - savetables.stateful(::upgrades) + savetables.stateful(upgrades::container, "upgrades") } val matter = ProfiledMatterStorage(MatterStorageImpl(::markDirtyFast, FlowDirection.OUTPUT, upgrades.matterCapacity(MachinesConfig.MATTER_DECOMPOSER::matterCapacity))) diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/matter/MatterEntanglerBlockEntity.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/matter/MatterEntanglerBlockEntity.kt index 82def3e57..9d4e37098 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/matter/MatterEntanglerBlockEntity.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/matter/MatterEntanglerBlockEntity.kt @@ -144,7 +144,7 @@ class MatterEntanglerBlockEntity(blockPos: BlockPos, blockState: BlockState) : M savetables.stateful(::energy, ENERGY_KEY) savetables.stateful(::matter, MATTER_STORAGE_KEY) - savetables.stateful(::upgrades) + savetables.stateful(upgrades::container, "upgrades") savetables.stateful(inputs::parent, "inputs") savetables.stateful(::output) savetables.stateful(::experience) diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/matter/MatterReconstructorBlockEntity.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/matter/MatterReconstructorBlockEntity.kt index 2ce185aca..9a9a9bc87 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/matter/MatterReconstructorBlockEntity.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/matter/MatterReconstructorBlockEntity.kt @@ -37,8 +37,7 @@ import ru.dbotthepony.mc.otm.menu.matter.MatterReconstructorMenu import ru.dbotthepony.mc.otm.registry.game.MBlockEntities import java.util.function.BooleanSupplier -class MatterReconstructorBlockEntity(blockPos: BlockPos, blockState: BlockState) : MatteryPoweredBlockEntity( - MBlockEntities.MATTER_RECONSTRUCTOR, blockPos, blockState) { +class MatterReconstructorBlockEntity(blockPos: BlockPos, blockState: BlockState) : MatteryPoweredBlockEntity(MBlockEntities.MATTER_RECONSTRUCTOR, blockPos, blockState) { val repairContainer = MatteryContainer(::containerChanged, 1).also(::addDroppableContainer) private var matterPerTick = Decimal.ZERO @@ -86,7 +85,7 @@ class MatterReconstructorBlockEntity(blockPos: BlockPos, blockState: BlockState) savetables.stateful(::repairContainer) savetables.stateful(::matter) savetables.stateful(::energy) - savetables.stateful(::upgrades) + savetables.stateful(upgrades::container, "upgrades") savetables.decimal(::matterPerTick) savetables.double(::progressPerTick) diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/matter/MatterRecyclerBlockEntity.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/matter/MatterRecyclerBlockEntity.kt index d8fe21afe..6f6616193 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/matter/MatterRecyclerBlockEntity.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/matter/MatterRecyclerBlockEntity.kt @@ -72,7 +72,7 @@ class MatterRecyclerBlockEntity(blockPos: BlockPos, blockState: BlockState) savetables.stateful(::energy, ENERGY_KEY) savetables.stateful(::container, INVENTORY_KEY) savetables.stateful(::matter, MATTER_STORAGE_KEY) - savetables.stateful(::upgrades) + savetables.stateful(upgrades::container, "upgrades") } override fun setRemoved() { diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/matter/MatterReplicatorBlockEntity.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/matter/MatterReplicatorBlockEntity.kt index ac9f9c181..e97ae3b62 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/matter/MatterReplicatorBlockEntity.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/matter/MatterReplicatorBlockEntity.kt @@ -103,7 +103,7 @@ class MatterReplicatorBlockEntity(p_155229_: BlockPos, p_155230_: BlockState) : savetables.stateful(::matter, MATTER_STORAGE_KEY) savetables.stateful(::outputContainer, INVENTORY_KEY) savetables.stateful(::dustContainer) - savetables.stateful(::upgrades) + savetables.stateful(upgrades::container, "upgrades") } override fun createMenu(containerID: Int, inventory: Inventory, ply: Player): AbstractContainerMenu { diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/matter/MatterScannerBlockEntity.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/matter/MatterScannerBlockEntity.kt index d57799340..15609ed92 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/matter/MatterScannerBlockEntity.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/matter/MatterScannerBlockEntity.kt @@ -68,7 +68,7 @@ class MatterScannerBlockEntity(p_155229_: BlockPos, p_155230_: BlockState) : savetables.stateful(::container, INVENTORY_KEY) savetables.stateful(::energy, ENERGY_KEY) - savetables.stateful(::upgrades) + savetables.stateful(upgrades::container, "upgrades") } override fun setRemoved() { diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/tech/AbstractPoweredFurnaceBlockEntity.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/tech/AbstractPoweredFurnaceBlockEntity.kt index 6defd22b6..beecf43c4 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/tech/AbstractPoweredFurnaceBlockEntity.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/tech/AbstractPoweredFurnaceBlockEntity.kt @@ -84,7 +84,7 @@ sealed class AbstractPoweredFurnaceBlockEntity
= UpgradeType.ALL,
val shouldLockUpgradeSlots: BooleanSupplier = BooleanSupplier { false },
listener: Runnable = Runnable {}
-) : MatteryContainer(listener, slotCount), IMatteryUpgrade {
+) : IMatteryUpgrade {
+ val container = SlottedContainer.simple(slotCount, listener)
+
override val upgradeTypes: Set