simple check for durability in item reconstructor

This commit is contained in:
YuRaNnNzZZ 2025-02-16 00:34:01 +03:00
parent 533cb16dbf
commit e747143512
Signed by: YuRaNnNzZZ
GPG Key ID: 5F71738C85A6006D

View File

@ -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