From 657b388e55e29930bd42f84e3df2b07e722fe791 Mon Sep 17 00:00:00 2001 From: DBotThePony Date: Thu, 24 Nov 2022 16:27:58 +0700 Subject: [PATCH] Rebalance black hole to new matter values --- .../block/entity/blackhole/BlackHoleBlockEntity.kt | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/blackhole/BlackHoleBlockEntity.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/blackhole/BlackHoleBlockEntity.kt index 1a71fd899..b260e88c8 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/blackhole/BlackHoleBlockEntity.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/blackhole/BlackHoleBlockEntity.kt @@ -57,7 +57,7 @@ class BlackHoleBlockEntity(p_155229_: BlockPos, p_155230_: BlockState) : Synchro 6 -> {massForDiv /= 16384} } - gravitationStrength = sqrt(massForDiv.div(BASELINE_MASS).toDouble()).coerceAtMost(20.0).coerceAtLeast(0.2) + gravitationStrength = sqrt(massForDiv.div(BASELINE_MASS).toDouble()).coerceIn(0.2, 40.0) affectedBounds = BoundingBox( (-30 * gravitationStrength).toInt(), @@ -267,7 +267,7 @@ class BlackHoleBlockEntity(p_155229_: BlockPos, p_155230_: BlockState) : Synchro } if (gravitationStrength > 0.4) { - val sphere = getSphericalBlockPositions((gravitationStrength * 6.0).roundToInt()) + val sphere = getSphericalBlockPositions((gravitationStrength * 12.0).roundToInt()) if (sphere.size != lastSphereSizeOuter) { lastSphereSizeOuter = sphere.size @@ -304,11 +304,11 @@ class BlackHoleBlockEntity(p_155229_: BlockPos, p_155230_: BlockState) : Synchro var strengthLinear = sqrt(blockPos.distSqr(pos)) - if (strengthLinear < gravitationStrength * 1.1) { - strengthLinear /= 4.0 + if (strengthLinear < gravitationStrength) { + strengthLinear *= 1.0 + 8.0 * (gravitationStrength - strengthLinear) / gravitationStrength } - if (speed >= 0f && (speed * 2f).coerceAtLeast(eResist / 3f) < gravitationStrength * (8.0 / strengthLinear)) { + if (speed >= 0f && (speed * 2f).coerceAtLeast(eResist / 3f) < gravitationStrength * (12.0 / strengthLinear)) { Block.dropResources(getBlock, level, pos, level.getBlockEntity(pos)) getBlock.block.destroy(level, pos, getBlock) level.setBlock(pos, getBlock.fluidState.createLegacyBlock(), Block.UPDATE_ALL) @@ -327,7 +327,7 @@ class BlackHoleBlockEntity(p_155229_: BlockPos, p_155230_: BlockState) : Synchro companion object { const val ITERATIONS = 30_000 - val BASELINE_MASS = ImpreciseFraction(1_000) - val HAWKING_MASS_LOSE_STEP = ImpreciseFraction("-0.1") + val BASELINE_MASS = ImpreciseFraction(50_000) + val HAWKING_MASS_LOSE_STEP = ImpreciseFraction(-100) } }