9
0
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:
Will FP
2023-12-27 17:53:04 +01:00
parent 9d407b9dea
commit 3753c93bf5

View File

@@ -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