mirror of
https://github.com/Auxilor/EcoMobs.git
synced 2025-12-19 23:19:17 +00:00
Improved error message
This commit is contained in:
@@ -353,7 +353,6 @@ internal class ConfigDrivenEcoMob(
|
|||||||
return trackedMobs[uuid]
|
return trackedMobs[uuid]
|
||||||
}
|
}
|
||||||
|
|
||||||
@Suppress("UNCHECKED_CAST")
|
|
||||||
override fun spawn(location: Location, reason: SpawnReason): LivingMob? {
|
override fun spawn(location: Location, reason: SpawnReason): LivingMob? {
|
||||||
// Call bukkit event
|
// Call bukkit event
|
||||||
val preSpawnEvent = EcoMobPreSpawnEvent(this, reason)
|
val preSpawnEvent = EcoMobPreSpawnEvent(this, reason)
|
||||||
@@ -364,7 +363,7 @@ internal class ConfigDrivenEcoMob(
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Spawn bukkit mob
|
// Spawn bukkit mob
|
||||||
val entity = mob.spawn(location) as? Mob ?: throw IllegalStateException("Mob is not a mob")
|
val entity = mob.spawn(location) as? Mob ?: throw IllegalStateException("Base entity must be a mob!")
|
||||||
|
|
||||||
// Mark as custom mob
|
// Mark as custom mob
|
||||||
entity.ecoMob = this
|
entity.ecoMob = this
|
||||||
|
|||||||
Reference in New Issue
Block a user