From a7b09441c5a4c1da03408246d3cd3a78e8253dfe Mon Sep 17 00:00:00 2001 From: DBotThePony Date: Tue, 25 Oct 2022 21:35:17 +0700 Subject: [PATCH] More smart energy distribution in battery bank --- .../dbotthepony/mc/otm/block/entity/BatteryBankBlockEntity.kt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/BatteryBankBlockEntity.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/BatteryBankBlockEntity.kt index 576bfa4ed..f1c1335d9 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/BatteryBankBlockEntity.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/BatteryBankBlockEntity.kt @@ -95,9 +95,9 @@ class BatteryBankBlockEntity(p_155229_: BlockPos, p_155230_: BlockState) : Matte val diff: ImpreciseFraction if (isReceiving) { - diff = it.receiveEnergy(ImpreciseFraction.LONG_MAX_VALUE, true) + diff = it.receiveEnergy(it.maxEnergyStoredMattery, true) } else { - diff = it.extractEnergy(ImpreciseFraction.LONG_MAX_VALUE, true) + diff = it.extractEnergy(it.energyStoredMattery, true) } distribution[i] = diff