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)
|
stack.shrink(1)
|
||||||
container.setChanged(0)
|
container.setChanged(0)
|
||||||
|
|
||||||
val actualMatter = dustMatter.matter * (0.4 + level!!.otmRandom.nextDouble() * 0.6)
|
val actualMatter = dustMatter.matter
|
||||||
|
|
||||||
return JobContainer.success(
|
return JobContainer.success(
|
||||||
RecyclerJob(
|
RecyclerJob(
|
||||||
@ -134,10 +134,11 @@ class MatterRecyclerBlockEntity(blockPos: BlockPos, blockState: BlockState)
|
|||||||
|
|
||||||
if (toReceive.isZero)
|
if (toReceive.isZero)
|
||||||
return status.success()
|
return status.success()
|
||||||
|
else if (matter.receiveMatter(toReceive, true) != toReceive)
|
||||||
|
return status.noMatter()
|
||||||
|
|
||||||
val received = matter.receiveMatter(toReceive, false)
|
matter.receiveMatter(toReceive * 0.4 + level!!.otmRandom.nextDouble() * 0.6, false)
|
||||||
status.scale(received / toReceive)
|
job.totalMatter -= toReceive
|
||||||
job.totalMatter -= received
|
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun tick() {
|
override fun tick() {
|
||||||
|
Loading…
Reference in New Issue
Block a user