Failsafe when blackhole block entity gets removed
This commit is contained in:
parent
7d075ccfc3
commit
b10b1c0da4
@ -162,7 +162,7 @@ class BlackHoleGeneratorBlockEntity(blockPos: BlockPos, blockState: BlockState)
|
||||
if (!multiblock.update(level, blockRotation.front)) {
|
||||
this.lastRange = findBlackHoleRange()
|
||||
} else {
|
||||
val blackHole = multiblock.blockEntities(BLACK_HOLE).first()
|
||||
val blackHole = multiblock.blockEntities(BLACK_HOLE).firstOrNull() ?: return
|
||||
|
||||
val matterExtracted = matter.extractMatter(if (mode == Mode.TARGET_MASS && blackHole.mass != targetMass) minOf(injectionRate, (blackHole.mass - targetMass).absoluteValue) else injectionRate, true)
|
||||
if (!matterExtracted.isPositive) return
|
||||
|
Loading…
Reference in New Issue
Block a user