diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/blackhole/BlackHoleGeneratorBlockEntity.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/blackhole/BlackHoleGeneratorBlockEntity.kt index 58f6b4222..3318c44a4 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/blackhole/BlackHoleGeneratorBlockEntity.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/blackhole/BlackHoleGeneratorBlockEntity.kt @@ -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