Blackhole "destroy blocks" config entry

This commit is contained in:
DBotThePony 2023-07-05 21:19:31 +07:00
parent 0ad88d668c
commit 87d29f0c4b
Signed by: DBot
GPG Key ID: DCC23B5715498507
2 changed files with 5 additions and 1 deletions

View File

@ -278,7 +278,7 @@ class BlackHoleBlockEntity(p_155229_: BlockPos, p_155230_: BlockState) : Mattery
this.mass += HAWKING_MASS_LOSE_STEP this.mass += HAWKING_MASS_LOSE_STEP
} }
if (gravitationStrength > 0.4) { if (ServerConfig.Blackhole.DESTROY_BLOCKS && gravitationStrength > 0.4) {
val sphere = getSphericalBlockPositions((gravitationStrength * 12.0).roundToInt()) val sphere = getSphericalBlockPositions((gravitationStrength * 12.0).roundToInt())
if (sphere.size != lastSphereSizeOuter) { if (sphere.size != lastSphereSizeOuter) {

View File

@ -51,6 +51,10 @@ object ServerConfig : AbstractConfig("misc") {
val BOSS_FORCE_MULTIPLIER: Double by builder val BOSS_FORCE_MULTIPLIER: Double by builder
.comment("Percentage of gravity force experienced by bosses (forge:bosses tag) from Singularities") .comment("Percentage of gravity force experienced by bosses (forge:bosses tag) from Singularities")
.defineInRange("BOSS_FORCE_MULTIPLIER", 0.4, 0.0, Float.MAX_VALUE.toDouble()) .defineInRange("BOSS_FORCE_MULTIPLIER", 0.4, 0.0, Float.MAX_VALUE.toDouble())
val DESTROY_BLOCKS: Boolean by builder
.comment("Whenever singularities should destroy blocks")
.define("DESTROY_BLOCKS", true)
} }
init { init {