Make matter recycler receive random amount of matter on tick instead of determining total matter received upon job start
This commit is contained in:
parent
0126d4d976
commit
0a9e90bec6
@ -117,7 +117,7 @@ class MatterRecyclerBlockEntity(blockPos: BlockPos, blockState: BlockState)
|
||||
stack.shrink(1)
|
||||
container.setChanged(0)
|
||||
|
||||
val actualMatter = dustMatter.matter * (0.4 + level!!.otmRandom.nextDouble() * 0.6)
|
||||
val actualMatter = dustMatter.matter
|
||||
|
||||
return JobContainer.success(
|
||||
RecyclerJob(
|
||||
@ -134,10 +134,11 @@ class MatterRecyclerBlockEntity(blockPos: BlockPos, blockState: BlockState)
|
||||
|
||||
if (toReceive.isZero)
|
||||
return status.success()
|
||||
else if (matter.receiveMatter(toReceive, true) != toReceive)
|
||||
return status.noMatter()
|
||||
|
||||
val received = matter.receiveMatter(toReceive, false)
|
||||
status.scale(received / toReceive)
|
||||
job.totalMatter -= received
|
||||
matter.receiveMatter(toReceive * 0.4 + level!!.otmRandom.nextDouble() * 0.6, false)
|
||||
job.totalMatter -= toReceive
|
||||
}
|
||||
|
||||
override fun tick() {
|
||||
|
Loading…
Reference in New Issue
Block a user