From 42dcd220430b1b185fac6234b85b6e6d25ccfab2 Mon Sep 17 00:00:00 2001 From: DBotThePony Date: Mon, 27 Mar 2023 18:34:20 +0700 Subject: [PATCH] hmm --- .../otm/block/entity/matter/MatterReconstructorBlockEntity.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/matter/MatterReconstructorBlockEntity.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/matter/MatterReconstructorBlockEntity.kt index 7fcf7bcf5..c1a99e6cf 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/matter/MatterReconstructorBlockEntity.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/matter/MatterReconstructorBlockEntity.kt @@ -230,7 +230,7 @@ class MatterReconstructorBlockEntity(blockPos: BlockPos, blockState: BlockState) val graph = matterNode.graph as MatterGraph? if (graph != null) { - val toDrain = (matterPerTick * EXTRACT_TICKS.coerceAtMost(item.damageValue)).coerceAtLeast(Decimal.ZERO).coerceAtMost(matter.missingMatter) + val toDrain = (matterPerTick * EXTRACT_TICKS.coerceAtMost(item.damageValue) - matter.storedMatter).coerceAtLeast(Decimal.ZERO).coerceAtMost(matter.missingMatter) matter.receiveMatterInner(graph.extractMatter(toDrain, false), false) } }