From 7f9af78734f0e81840a6f57b108eee5044d11138 Mon Sep 17 00:00:00 2001 From: DBotThePony Date: Mon, 3 Mar 2025 19:55:52 +0700 Subject: [PATCH] Update MatteryPoweredBlockEntity battery container to use SlottedContainer --- .../mc/otm/block/entity/MatteryPoweredBlockEntity.kt | 6 +++--- .../mc/otm/block/entity/matter/MatterBottlerBlockEntity.kt | 2 +- .../block/entity/tech/AbstractPoweredFurnaceBlockEntity.kt | 2 +- .../kotlin/ru/dbotthepony/mc/otm/menu/MatteryPoweredMenu.kt | 3 ++- 4 files changed, 7 insertions(+), 6 deletions(-) diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/MatteryPoweredBlockEntity.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/MatteryPoweredBlockEntity.kt index 40f1bd7b9..7455987c3 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/MatteryPoweredBlockEntity.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/MatteryPoweredBlockEntity.kt @@ -7,12 +7,12 @@ import ru.dbotthepony.mc.otm.capability.energy import ru.dbotthepony.mc.otm.capability.energy.IMatteryEnergyStorage import ru.dbotthepony.mc.otm.capability.extractEnergy import ru.dbotthepony.mc.otm.container.HandlerFilter -import ru.dbotthepony.mc.otm.container.MatteryContainer +import ru.dbotthepony.mc.otm.container.slotted.AutomationFilters +import ru.dbotthepony.mc.otm.container.slotted.SlottedContainer import ru.dbotthepony.mc.otm.core.math.Decimal abstract class MatteryPoweredBlockEntity(p_155228_: BlockEntityType<*>, p_155229_: BlockPos, p_155230_: BlockState) : MatteryDeviceBlockEntity(p_155228_, p_155229_, p_155230_) { - val batteryContainer = MatteryContainer(::markDirtyFast, 1).also(::addDroppableContainer) - val batteryItemHandler = batteryContainer.handler(HandlerFilter.Dischargeable) + val batteryContainer = SlottedContainer.simple(1, AutomationFilters.DISCHARGABLE.simpleProvider, ::markDirtyFast).also(::addDroppableContainer) open val energy: IMatteryEnergyStorage? get() = null 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 0a39c82f0..c93febf88 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 @@ -85,7 +85,7 @@ class MatterBottlerBlockEntity(blockPos: BlockPos, blockState: BlockState) : val itemConfig = ConfigurableItemHandler( input = inputHandler, output = outputHandler, - battery = batteryItemHandler + battery = batteryContainer ) val matter: ProfiledMatterStorage = ProfiledMatterStorage(object : MatterStorageImpl(this@MatterBottlerBlockEntity::markDirtyFast, FlowDirection.BI_DIRECTIONAL, upgrades.matterCapacity(MachinesConfig.MatterBottler.VALUES::matterCapacity)) { 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 4ca9c7317..6defd22b6 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 @@ -78,7 +78,7 @@ sealed class AbstractPoweredFurnaceBlockEntity

(this) init {