Fix gravitation overflow on very weak gravtiations
This commit is contained in:
parent
784c57d9eb
commit
bb3da639b0
@ -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()
|
||||
|
Loading…
Reference in New Issue
Block a user