From bb3da639b0e2a2cffa9c7e05e6e4eaa04bee8f2f Mon Sep 17 00:00:00 2001 From: DBotThePony Date: Thu, 20 Jan 2022 11:56:21 +0700 Subject: [PATCH] Fix gravitation overflow on very weak gravtiations --- .../mc/otm/block/entity/blackhole/BlockEntityBlackHole.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/blackhole/BlockEntityBlackHole.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/blackhole/BlockEntityBlackHole.kt index 0a9375fac..d52038380 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/blackhole/BlockEntityBlackHole.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/blackhole/BlockEntityBlackHole.kt @@ -202,7 +202,7 @@ class BlockEntityBlackHole(p_155229_: BlockPos, p_155230_: BlockState) : BlockEn private fun setDeltaMovement(living: Entity, center: Vec3, distance: Double, weaker: Boolean) { //final double mult = Math.min(2, (30 * this.gravitation_strength) / Math.max(1, Math.pow(distance, 2))); // Сила притяжения - val mult = Math.pow(1 - distance / (30 * gravitationStrength), 2.0) * gravitationStrength / 8 + val mult = Math.pow((1 - distance / (30 * gravitationStrength)).coerceAtLeast(0.0), 2.0) * gravitationStrength / 8 // Притяжение к ядру val delta = living.position().vectorTo(center).normalize()