Un-seal BlockEnergyStorageImpl

This commit is contained in:
DBotThePony 2024-01-28 23:23:21 +07:00
parent 7e5711d210
commit cd5f9dff2e
Signed by: DBot
GPG Key ID: DCC23B5715498507

View File

@ -13,13 +13,25 @@ import ru.dbotthepony.mc.otm.core.math.Decimal
import ru.dbotthepony.mc.otm.core.nbt.mapPresent
import ru.dbotthepony.mc.otm.core.nbt.set
sealed class BlockEnergyStorageImpl(
open class BlockEnergyStorageImpl(
protected val listener: () -> Unit,
final override val energyFlow: FlowDirection,
private val maxBatteryLevelProvider: () -> Decimal,
private val maxInputProvider: () -> Decimal?,
private val maxOutputProvider: () -> Decimal?,
) : IMatteryEnergyStorage, INBTSerializable<CompoundTag?>, IEnergyStorageImpl {
constructor(
listener: () -> Unit,
energyFlow: FlowDirection,
values: EnergyBalanceValues
) : this(listener, energyFlow, values::energyCapacity, values::energyThroughput, values::energyThroughput)
constructor(
listener: () -> Unit,
energyFlow: FlowDirection,
values: VerboseEnergyBalanceValues
) : this(listener, energyFlow, values::energyCapacity, values::maxEnergyReceive, values::maxEnergyExtract)
private var maxInputStorage: Decimal? = null
private var maxOutputStorage: Decimal? = null
private var maxBatteryLevelStorage: Decimal? = null