Nerf max power storage of buses

This commit is contained in:
DBotThePony 2022-05-14 18:41:50 +07:00
parent 3e66862de8
commit 89c3b22913
Signed by: DBot
GPG Key ID: DCC23B5715498507
2 changed files with 5 additions and 3 deletions

View File

@ -57,8 +57,7 @@ class StorageBusBlockEntity(blockPos: BlockPos, blockState: BlockState) : Matter
return null return null
} }
override val energy = WorkerEnergyStorage(this) override val energy = WorkerEnergyStorage(this, maxBatteryLevel = MAX_POWER)
val cell = BasicStorageGraphNode(energy) val cell = BasicStorageGraphNode(energy)
override fun setLevel(p_155231_: Level) { override fun setLevel(p_155231_: Level) {
@ -139,6 +138,7 @@ class StorageBusBlockEntity(blockPos: BlockPos, blockState: BlockState) : Matter
companion object { companion object {
private val MACHINE_NAME = TranslatableComponent("block.${OverdriveThatMatters.MOD_ID}.${MNames.STORAGE_BUS}") 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<ItemStackWrapper> { private inner class ItemHandlerComponent(private val parent: IItemHandler) : IStorageComponent<ItemStackWrapper> {

View File

@ -19,6 +19,7 @@ import ru.dbotthepony.mc.otm.block.RotatableMatteryBlock
import ru.dbotthepony.mc.otm.capability.MatteryCapability import ru.dbotthepony.mc.otm.capability.MatteryCapability
import ru.dbotthepony.mc.otm.capability.WorkerEnergyStorage import ru.dbotthepony.mc.otm.capability.WorkerEnergyStorage
import ru.dbotthepony.mc.otm.capability.extractStepInner 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.core.plus
import ru.dbotthepony.mc.otm.graph.storage.BasicStorageGraphNode import ru.dbotthepony.mc.otm.graph.storage.BasicStorageGraphNode
import ru.dbotthepony.mc.otm.graph.storage.StorageNetworkGraph import ru.dbotthepony.mc.otm.graph.storage.StorageNetworkGraph
@ -32,7 +33,7 @@ class StorageImporterBlockEntity(blockPos: BlockPos, blockState: BlockState) : M
override val defaultDisplayName: Component override val defaultDisplayName: Component
get() = MACHINE_NAME get() = MACHINE_NAME
override val energy = WorkerEnergyStorage(this) override val energy = WorkerEnergyStorage(this, maxBatteryLevel = MAX_POWER)
val cell = BasicStorageGraphNode(energy) val cell = BasicStorageGraphNode(energy)
override fun createMenu(containerID: Int, inventory: Inventory, ply: Player): AbstractContainerMenu? { 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 val MACHINE_NAME = TranslatableComponent("block.${OverdriveThatMatters.MOD_ID}.${MNames.STORAGE_IMPORTER}")
private const val INTERVAL = 5 private const val INTERVAL = 5
private const val MAX_MOVE_PER_OPERATION = 4 private const val MAX_MOVE_PER_OPERATION = 4
private val MAX_POWER = ImpreciseFraction(10_000)
} }
} }