Make Matter Decomposer throttle for 1 tick when buffer can't fit all matter produced

This commit is contained in:
DBotThePony 2025-03-16 00:31:05 +07:00
parent f599f1c2b9
commit df5c8dc6aa
Signed by: DBot
GPG Key ID: DCC23B5715498507

View File

@ -106,10 +106,15 @@ class MatterDecomposerBlockEntity(pos: BlockPos, state: BlockState)
if (!status.job.matterValue.isZero)
status.throttleFast()
} else {
status.job.matterValue -= matter.receiveMatter(status.job.matterValue, false)
val received = matter.receiveMatter(status.job.matterValue, false)
status.job.matterValue -= received
if (status.job.matterValue.isPositive)
status.noMatter()
if (status.job.matterValue.isPositive) {
if (received.isPositive)
status.noMatter(1)
else
status.noMatter()
}
}
}