From 4faef9d7c92473282f37c9908cde0d2b0b8e920e Mon Sep 17 00:00:00 2001 From: YuRaNnNzZZ Date: Fri, 4 Apr 2025 22:09:35 +0300 Subject: [PATCH] =?UTF-8?q?=D0=A9=D0=90=D0=A1=20=D0=91=D0=A3=D0=94=D0=95?= =?UTF-8?q?=D0=A2=20=D0=A2=D0=95=D0=91=D0=95=20=D0=A2=D0=9E=D0=A7=D0=9D?= =?UTF-8?q?=D0=9E=D0=A1=D0=A2=D0=AC=20=D0=A7=D0=98=D0=A1=D0=9B=D0=90.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mc/otm/block/entity/matter/MatterBottlerBlockEntity.kt | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) 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 84f29f5bf..16ecea421 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 @@ -29,6 +29,7 @@ import ru.dbotthepony.mc.otm.registry.game.MBlockEntities import ru.dbotthepony.mc.otm.util.math.Decimal import ru.dbotthepony.mc.otm.util.countingLazy import ru.dbotthepony.mc.otm.graph.matter.SimpleMatterNode +import ru.dbotthepony.mc.otm.util.math.toDecimal import java.util.function.BooleanSupplier class MatterBottlerBlockEntity(blockPos: BlockPos, blockState: BlockState) : @@ -262,8 +263,8 @@ class MatterBottlerBlockEntity(blockPos: BlockPos, blockState: BlockState) : initialCapacity = initialCapacity ?: it.storedMatter hasCapacitors = true - val rate = MachinesConfig.MatterBottler.RATE * (1.0 + upgrades.speedBonus) - val energyRate = MachinesConfig.MatterBottler.VALUES.energyConsumption * (1.0 + upgrades.speedBonus) + val rate = MachinesConfig.MatterBottler.RATE * (Decimal.ONE + upgrades.speedBonus.toDecimal()) + val energyRate = MachinesConfig.MatterBottler.VALUES.energyConsumption * (Decimal.ONE + upgrades.speedBonus.toDecimal()) val energyRatio = if (energyRate <= Decimal.ZERO) Decimal.ONE else energy.extractEnergy(energyRate, true) / energyRate val matterRatio = matter.receiveMatter(it.extractMatterChecked(rate, true), true) / rate