mirror of
https://github.com/Auxilor/EcoMobs.git
synced 2025-12-19 23:19:17 +00:00
Improved spawn method
This commit is contained in:
@@ -66,15 +66,16 @@ object SpawnMethodFactoryCustom : SpawnMethodFactory("custom") {
|
|||||||
private fun tick() {
|
private fun tick() {
|
||||||
for (player in Bukkit.getOnlinePlayers()) {
|
for (player in Bukkit.getOnlinePlayers()) {
|
||||||
for (point in player.spawnPoints.filter { it.type in spawnTypes }) {
|
for (point in player.spawnPoints.filter { it.type in spawnTypes }) {
|
||||||
if (randDouble(0.0, 100.0) > chance) {
|
val mob = category.mobs.randomOrNull() ?: continue
|
||||||
continue
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!conditions.areMet(point.location.toDispatcher(), EmptyProvidedHolder)) {
|
if (!conditions.areMet(point.location.toDispatcher(), EmptyProvidedHolder)) {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
|
||||||
val mob = category.mobs.randomOrNull() ?: continue
|
if (randDouble(0.0, 100.0) > chance) {
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
|
||||||
mob.spawn(point.location, SpawnReason.NATURAL)
|
mob.spawn(point.location, SpawnReason.NATURAL)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user