Compare commits
2 Commits
533cb16dbf
...
b1915248a9
Author | SHA1 | Date | |
---|---|---|---|
b1915248a9 | |||
e747143512 |
@ -20,6 +20,7 @@ import net.minecraft.world.phys.shapes.CollisionContext
|
|||||||
import net.minecraft.world.phys.shapes.VoxelShape
|
import net.minecraft.world.phys.shapes.VoxelShape
|
||||||
import net.neoforged.neoforge.fluids.FluidUtil
|
import net.neoforged.neoforge.fluids.FluidUtil
|
||||||
import ru.dbotthepony.mc.otm.block.RotatableMatteryBlock
|
import ru.dbotthepony.mc.otm.block.RotatableMatteryBlock
|
||||||
|
import ru.dbotthepony.mc.otm.block.addSimpleDescription
|
||||||
import ru.dbotthepony.mc.otm.block.entity.decorative.InfiniteWaterSourceBlockEntity
|
import ru.dbotthepony.mc.otm.block.entity.decorative.InfiniteWaterSourceBlockEntity
|
||||||
import ru.dbotthepony.mc.otm.block.getShapeForEachState
|
import ru.dbotthepony.mc.otm.block.getShapeForEachState
|
||||||
import ru.dbotthepony.mc.otm.core.get
|
import ru.dbotthepony.mc.otm.core.get
|
||||||
@ -39,6 +40,10 @@ class InfiniteWaterSourceBlock : RotatableMatteryBlock(
|
|||||||
return InfiniteWaterSourceBlockEntity(p_153215_, p_153216_)
|
return InfiniteWaterSourceBlockEntity(p_153215_, p_153216_)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
init {
|
||||||
|
addSimpleDescription()
|
||||||
|
}
|
||||||
|
|
||||||
override fun useItemOn(
|
override fun useItemOn(
|
||||||
p_316304_: ItemStack,
|
p_316304_: ItemStack,
|
||||||
p_316362_: BlockState,
|
p_316362_: BlockState,
|
||||||
|
@ -223,7 +223,7 @@ class MatterReconstructorBlockEntity(blockPos: BlockPos, blockState: BlockState)
|
|||||||
val matterPerTick = matterPerTick * (1.0 + upgrades.speedBonus)
|
val matterPerTick = matterPerTick * (1.0 + upgrades.speedBonus)
|
||||||
val energyConsumption = MachinesConfig.MatterReconstructor.VALUES.energyConsumption * (1.0 + upgrades.speedBonus) * (upgrades.energyConsumed + Decimal.ONE)
|
val energyConsumption = MachinesConfig.MatterReconstructor.VALUES.energyConsumption * (1.0 + upgrades.speedBonus) * (upgrades.energyConsumed + Decimal.ONE)
|
||||||
|
|
||||||
if (!item.isEmpty && matterPerTick.isPositive && thisProgressPerTick > 0.0 && item.isRepairable && item.isDamaged) {
|
if (!item.isEmpty && matterPerTick.isPositive && thisProgressPerTick > 0.0 && item.isRepairable && item.isDamaged && item.maxDamage > 0) {
|
||||||
var progressPerTick = (repairProgress + thisProgressPerTick).coerceAtMost(item.damageValue.toDouble()) - repairProgress
|
var progressPerTick = (repairProgress + thisProgressPerTick).coerceAtMost(item.damageValue.toDouble()) - repairProgress
|
||||||
if (progressPerTick <= 0.0) return
|
if (progressPerTick <= 0.0) return
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user