From 89c3b22913576e5ba83e26b736bb009a57003b02 Mon Sep 17 00:00:00 2001 From: DBotThePony Date: Sat, 14 May 2022 18:41:50 +0700 Subject: [PATCH] Nerf max power storage of buses --- .../dbotthepony/mc/otm/block/entity/StorageBusBlockEntity.kt | 4 ++-- .../ru/dbotthepony/mc/otm/block/entity/StorageInterfaces.kt | 4 +++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/StorageBusBlockEntity.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/StorageBusBlockEntity.kt index a12a28c5b..537228de4 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/StorageBusBlockEntity.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/StorageBusBlockEntity.kt @@ -57,8 +57,7 @@ class StorageBusBlockEntity(blockPos: BlockPos, blockState: BlockState) : Matter return null } - override val energy = WorkerEnergyStorage(this) - + override val energy = WorkerEnergyStorage(this, maxBatteryLevel = MAX_POWER) val cell = BasicStorageGraphNode(energy) override fun setLevel(p_155231_: Level) { @@ -139,6 +138,7 @@ class StorageBusBlockEntity(blockPos: BlockPos, blockState: BlockState) : Matter companion object { private val MACHINE_NAME = TranslatableComponent("block.${OverdriveThatMatters.MOD_ID}.${MNames.STORAGE_BUS}") + private val MAX_POWER = ImpreciseFraction(10_000) } private inner class ItemHandlerComponent(private val parent: IItemHandler) : IStorageComponent { diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/StorageInterfaces.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/StorageInterfaces.kt index a151a3daa..ab09f01ba 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/StorageInterfaces.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/StorageInterfaces.kt @@ -19,6 +19,7 @@ import ru.dbotthepony.mc.otm.block.RotatableMatteryBlock import ru.dbotthepony.mc.otm.capability.MatteryCapability import ru.dbotthepony.mc.otm.capability.WorkerEnergyStorage import ru.dbotthepony.mc.otm.capability.extractStepInner +import ru.dbotthepony.mc.otm.core.ImpreciseFraction import ru.dbotthepony.mc.otm.core.plus import ru.dbotthepony.mc.otm.graph.storage.BasicStorageGraphNode import ru.dbotthepony.mc.otm.graph.storage.StorageNetworkGraph @@ -32,7 +33,7 @@ class StorageImporterBlockEntity(blockPos: BlockPos, blockState: BlockState) : M override val defaultDisplayName: Component get() = MACHINE_NAME - override val energy = WorkerEnergyStorage(this) + override val energy = WorkerEnergyStorage(this, maxBatteryLevel = MAX_POWER) val cell = BasicStorageGraphNode(energy) override fun createMenu(containerID: Int, inventory: Inventory, ply: Player): AbstractContainerMenu? { @@ -133,5 +134,6 @@ class StorageImporterBlockEntity(blockPos: BlockPos, blockState: BlockState) : M private val MACHINE_NAME = TranslatableComponent("block.${OverdriveThatMatters.MOD_ID}.${MNames.STORAGE_IMPORTER}") private const val INTERVAL = 5 private const val MAX_MOVE_PER_OPERATION = 4 + private val MAX_POWER = ImpreciseFraction(10_000) } }