Make event horizon smaller
This commit is contained in:
parent
0fff4c003b
commit
e83075b5f1
@ -33,6 +33,7 @@ import ru.dbotthepony.mc.otm.registry.MItems
|
|||||||
import ru.dbotthepony.mc.otm.registry.MRegistry
|
import ru.dbotthepony.mc.otm.registry.MRegistry
|
||||||
import ru.dbotthepony.mc.otm.container.set
|
import ru.dbotthepony.mc.otm.container.set
|
||||||
import ru.dbotthepony.mc.otm.core.set
|
import ru.dbotthepony.mc.otm.core.set
|
||||||
|
import kotlin.math.pow
|
||||||
import kotlin.math.roundToInt
|
import kotlin.math.roundToInt
|
||||||
import kotlin.math.sqrt
|
import kotlin.math.sqrt
|
||||||
|
|
||||||
@ -261,6 +262,9 @@ class BlackHoleBlockEntity(p_155229_: BlockPos, p_155230_: BlockState) : BlockEn
|
|||||||
|
|
||||||
val center = Vec3.atCenterOf(blockPos)
|
val center = Vec3.atCenterOf(blockPos)
|
||||||
|
|
||||||
|
kotlin.run {
|
||||||
|
val gravitationStrength = gravitationStrength.pow(0.5)
|
||||||
|
|
||||||
for (living in level.getEntitiesOfClass(LivingEntity::class.java, affectedBoundsAABB)) {
|
for (living in level.getEntitiesOfClass(LivingEntity::class.java, affectedBoundsAABB)) {
|
||||||
val distance = living.position().distanceTo(center)
|
val distance = living.position().distanceTo(center)
|
||||||
|
|
||||||
@ -290,13 +294,14 @@ class BlackHoleBlockEntity(p_155229_: BlockPos, p_155230_: BlockState) : BlockEn
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// шанс 1% что черная дыра потеряет 0.1 MtU каждую секунду * силу гравитации дыры ^ -1
|
// шанс 1% что черная дыра потеряет 0.1 MtU каждую секунду * силу гравитации дыры ^ -1
|
||||||
if (level.random.nextDouble() < 0.01 * 0.05 * (1 / gravitationStrength)) {
|
if (level.random.nextDouble() < 0.01 * 0.05 * (1 / gravitationStrength)) {
|
||||||
this.mass += HAWKING_MASS_LOSE_STEP
|
this.mass += HAWKING_MASS_LOSE_STEP
|
||||||
}
|
}
|
||||||
|
|
||||||
if (gravitationStrength > 0.4f) {
|
if (gravitationStrength > 0.4) {
|
||||||
val sphere = getSphericalShape((gravitationStrength * 6.0).roundToInt())
|
val sphere = getSphericalShape((gravitationStrength * 6.0).roundToInt())
|
||||||
|
|
||||||
if (sphere.size != lastSphereSizeOuter) {
|
if (sphere.size != lastSphereSizeOuter) {
|
||||||
|
@ -20,6 +20,7 @@ import ru.dbotthepony.mc.otm.client.render.*
|
|||||||
import ru.dbotthepony.mc.otm.core.*
|
import ru.dbotthepony.mc.otm.core.*
|
||||||
import ru.dbotthepony.mc.otm.registry.MItems
|
import ru.dbotthepony.mc.otm.registry.MItems
|
||||||
import kotlin.math.PI
|
import kotlin.math.PI
|
||||||
|
import kotlin.math.pow
|
||||||
|
|
||||||
private const val BEAM_WIDTH = 0.2
|
private const val BEAM_WIDTH = 0.2
|
||||||
|
|
||||||
@ -103,7 +104,7 @@ class BlackHoleRenderer(private val context: BlockEntityRendererProvider.Context
|
|||||||
|
|
||||||
poseStack.pushPose()
|
poseStack.pushPose()
|
||||||
poseStack.translate(0.5, -tile.gravitationStrength / 2 + 0.5, 0.5)
|
poseStack.translate(0.5, -tile.gravitationStrength / 2 + 0.5, 0.5)
|
||||||
colorSphere(poseStack, tile.gravitationStrength.toFloat())
|
colorSphere(poseStack, tile.gravitationStrength.pow(0.5).toFloat())
|
||||||
|
|
||||||
RenderSystem.enableCull()
|
RenderSystem.enableCull()
|
||||||
RenderSystem.enableTexture()
|
RenderSystem.enableTexture()
|
||||||
|
Loading…
Reference in New Issue
Block a user