9
0
mirror of https://github.com/Auxilor/EcoMobs.git synced 2025-12-19 15:09:17 +00:00

Improved spawn method

This commit is contained in:
Will FP
2023-11-28 13:41:15 +00:00
parent 393c9d62d1
commit 7c162f5565

View File

@@ -66,15 +66,16 @@ object SpawnMethodFactoryCustom : SpawnMethodFactory("custom") {
private fun tick() {
for (player in Bukkit.getOnlinePlayers()) {
for (point in player.spawnPoints.filter { it.type in spawnTypes }) {
if (randDouble(0.0, 100.0) > chance) {
continue
}
val mob = category.mobs.randomOrNull() ?: continue
if (!conditions.areMet(point.location.toDispatcher(), EmptyProvidedHolder)) {
continue
}
val mob = category.mobs.randomOrNull() ?: continue
if (randDouble(0.0, 100.0) > chance) {
continue
}
mob.spawn(point.location, SpawnReason.NATURAL)
}
}