From e74714351220ad11bf9d101360b2fc85c1b9581b Mon Sep 17 00:00:00 2001 From: YuRaNnNzZZ Date: Sun, 16 Feb 2025 00:34:01 +0300 Subject: [PATCH] simple check for durability in item reconstructor --- .../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 21a5ded53..a949198a2 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 @@ -223,7 +223,7 @@ class MatterReconstructorBlockEntity(blockPos: BlockPos, blockState: BlockState) val matterPerTick = matterPerTick * (1.0 + upgrades.speedBonus) val energyConsumption = MachinesConfig.MatterReconstructor.VALUES.energyConsumption * (1.0 + upgrades.speedBonus) * (upgrades.energyConsumed + Decimal.ONE) - if (!item.isEmpty && matterPerTick.isPositive && thisProgressPerTick > 0.0 && item.isRepairable && item.isDamaged) { + if (!item.isEmpty && matterPerTick.isPositive && thisProgressPerTick > 0.0 && item.isRepairable && item.isDamaged && item.maxDamage > 0) { var progressPerTick = (repairProgress + thisProgressPerTick).coerceAtMost(item.damageValue.toDouble()) - repairProgress if (progressPerTick <= 0.0) return