From 3753c93bf51a34020ccb69fe6399fdf224b09c3c Mon Sep 17 00:00:00 2001 From: Will FP Date: Wed, 27 Dec 2023 17:53:04 +0100 Subject: [PATCH] Improved error message --- .../kotlin/com/willfp/ecomobs/mob/impl/ConfigDrivenEcoMob.kt | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/eco-core/core-plugin/src/main/kotlin/com/willfp/ecomobs/mob/impl/ConfigDrivenEcoMob.kt b/eco-core/core-plugin/src/main/kotlin/com/willfp/ecomobs/mob/impl/ConfigDrivenEcoMob.kt index 6c519f4..69162cc 100644 --- a/eco-core/core-plugin/src/main/kotlin/com/willfp/ecomobs/mob/impl/ConfigDrivenEcoMob.kt +++ b/eco-core/core-plugin/src/main/kotlin/com/willfp/ecomobs/mob/impl/ConfigDrivenEcoMob.kt @@ -353,7 +353,6 @@ internal class ConfigDrivenEcoMob( return trackedMobs[uuid] } - @Suppress("UNCHECKED_CAST") override fun spawn(location: Location, reason: SpawnReason): LivingMob? { // Call bukkit event val preSpawnEvent = EcoMobPreSpawnEvent(this, reason) @@ -364,7 +363,7 @@ internal class ConfigDrivenEcoMob( } // 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 entity.ecoMob = this