Fix matter replicator allocating jobs while not powered
This commit is contained in:
parent
49fd0dc105
commit
15d4dec2b1
@ -155,6 +155,10 @@ class MatterReplicatorBlockEntity(p_155229_: BlockPos, p_155230_: BlockState) :
|
||||
}
|
||||
|
||||
override fun computeNextJob(): Pair<ReplicatorJob?, IdleReason?> {
|
||||
if (energy.batteryLevel < BASE_CONSUMPTION) {
|
||||
return null to IdleReason.POWER
|
||||
}
|
||||
|
||||
val graph = matterNode.graph as MatterNetworkGraph? ?: return null to null
|
||||
val allocation = graph.allocateTask(simulate = false) ?: return null to IdleReason.OBSERVING
|
||||
val stack = allocation.task.stack(1)
|
||||
|
Loading…
Reference in New Issue
Block a user