Matter replicator failsafe upgrades support
This commit is contained in:
parent
ab51740ddf
commit
b3e6caf5ba
@ -102,7 +102,7 @@ class MatterReplicatorBlockEntity(p_155229_: BlockPos, p_155230_: BlockState) :
|
||||
}
|
||||
}
|
||||
|
||||
override val upgrades = UpgradeContainer(this::setChangedLight, 3, UpgradeType.BASIC_MATTER)
|
||||
override val upgrades = UpgradeContainer(this::setChangedLight, 3, UpgradeType.REPLICATOR)
|
||||
val energy = ProfiledEnergyStorage(WorkerEnergyStorage(::powerLevelUpdated, upgrades.transform(ENERGY_VALUES)))
|
||||
val matter = ProfiledMatterStorage(MatterStorageImpl(::matterLevelUpdated, FlowDirection.INPUT, upgrades.matterCapacity(::MATTER_CAPACITY)))
|
||||
val container = MatteryContainer(::itemContainerUpdated, 5).also(::addDroppableContainer)
|
||||
@ -215,7 +215,7 @@ class MatterReplicatorBlockEntity(p_155229_: BlockPos, p_155230_: BlockState) :
|
||||
task = allocation.task.asImmutable(),
|
||||
matterValue = matter.matter,
|
||||
pattern = allocation.pattern?.asImmutable(),
|
||||
asDust = (level?.random?.nextDouble() ?: 1.0) > (allocation.pattern?.researchPercent ?: 2.0),
|
||||
asDust = (level?.random?.nextDouble() ?: 1.0) * upgrades.failureMultiplier > (allocation.pattern?.researchPercent ?: 2.0),
|
||||
ticks = ticks,
|
||||
))
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user