9
0
mirror of https://github.com/Auxilor/EcoMobs.git synced 2025-12-21 07:59:28 +00:00

Added check for living bosses

This commit is contained in:
Auxilor
2021-05-02 10:24:33 +01:00
parent 21ed4b09fd
commit 5d69d0faee

View File

@@ -1,6 +1,7 @@
package com.willfp.ecobosses.bosses.listeners;
import com.willfp.eco.util.NumberUtils;
import com.willfp.ecobosses.EcoBossesPlugin;
import com.willfp.ecobosses.bosses.EcoBoss;
import com.willfp.ecobosses.bosses.EcoBosses;
import org.bukkit.Location;
@@ -21,6 +22,10 @@ public class AutoSpawnTimer implements Runnable {
continue;
}
if (!boss.getLivingBosses().isEmpty()) {
continue;
}
if (tick % boss.getAutoSpawnInterval() == 0) {
Location location = boss.getAutoSpawnLocations().get(NumberUtils.randInt(0, boss.getAutoSpawnLocations().size() - 1));
boss.spawn(location);