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,12 +106,17 @@ class MatterDecomposerBlockEntity(pos: BlockPos, state: BlockState)
if (!status.job.matterValue.isZero) if (!status.job.matterValue.isZero)
status.throttleFast() status.throttleFast()
} else { } 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) if (status.job.matterValue.isPositive) {
if (received.isPositive)
status.noMatter(1)
else
status.noMatter() status.noMatter()
} }
} }
}
override fun computeNextJob(id: Int): JobContainer<DecomposerJob> { override fun computeNextJob(id: Int): JobContainer<DecomposerJob> {
val stack = inputContainer[0] val stack = inputContainer[0]