From 0d846d9dffcc600c17219e3f9715cf4e66f9f339 Mon Sep 17 00:00:00 2001 From: Auxilor Date: Fri, 8 Apr 2022 18:03:39 +0100 Subject: [PATCH] Added autospawn.one-boss-per-world option --- .../kotlin/com/willfp/ecobosses/spawn/AutospawnHandler.kt | 6 ++++-- eco-core/core-plugin/src/main/resources/config.yml | 3 +++ 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/eco-core/core-plugin/src/main/kotlin/com/willfp/ecobosses/spawn/AutospawnHandler.kt b/eco-core/core-plugin/src/main/kotlin/com/willfp/ecobosses/spawn/AutospawnHandler.kt index 07acf03..c8fda22 100644 --- a/eco-core/core-plugin/src/main/kotlin/com/willfp/ecobosses/spawn/AutospawnHandler.kt +++ b/eco-core/core-plugin/src/main/kotlin/com/willfp/ecobosses/spawn/AutospawnHandler.kt @@ -22,8 +22,10 @@ object AutospawnHandler { val location = boss.autoSpawnLocations.randomOrNull() ?: continue val world = location.world ?: continue - if (Bosses.getAllAlive().mapNotNull { it.entity }.any { it.world == world }) { - continue + if (plugin.configYml.getBool("autospawn.one-boss-per-world")) { + if (Bosses.getAllAlive().mapNotNull { it.entity }.any { it.world == world }) { + continue + } } val spawnEvent = BossSpawnEvent(boss, location, BossSpawnEvent.SpawnReason.AUTOSPAWN, null) diff --git a/eco-core/core-plugin/src/main/resources/config.yml b/eco-core/core-plugin/src/main/resources/config.yml index 592082f..4a90e77 100644 --- a/eco-core/core-plugin/src/main/resources/config.yml +++ b/eco-core/core-plugin/src/main/resources/config.yml @@ -6,6 +6,9 @@ discover-recipes: true log-spawn-kill: true +autospawn: + one-boss-per-world: true # If only one boss can auto-spawn per world at once. + cooldown: in-actionbar: true sound: