From 9d407b9dea77d0b7f145813fa79ee856d8a73a6a Mon Sep 17 00:00:00 2001 From: Will FP Date: Wed, 27 Dec 2023 17:47:55 +0100 Subject: [PATCH] Fixed death animation not playing --- .../com/willfp/ecomobs/mob/impl/LivingMobImpl.kt | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/eco-core/core-plugin/src/main/kotlin/com/willfp/ecomobs/mob/impl/LivingMobImpl.kt b/eco-core/core-plugin/src/main/kotlin/com/willfp/ecomobs/mob/impl/LivingMobImpl.kt index 1eeb22d..d3b5773 100644 --- a/eco-core/core-plugin/src/main/kotlin/com/willfp/ecomobs/mob/impl/LivingMobImpl.kt +++ b/eco-core/core-plugin/src/main/kotlin/com/willfp/ecomobs/mob/impl/LivingMobImpl.kt @@ -27,7 +27,7 @@ internal class LivingMobImpl( if (!isAlive) { it.cancel() - remove() + handleRemove() } } @@ -78,23 +78,22 @@ internal class LivingMobImpl( } override fun kill(player: Player?) { - remove() + handleRemove() mob.spawnDrops(entity.location, player) } override fun despawn() { - remove() + entity.remove() + handleRemove() Bukkit.getPluginManager().callEvent( EcoMobDespawnEvent(this) ) } - private fun remove() { + private fun handleRemove() { ticker.cancel() - - entity.remove() deathCallback() for (handler in this.tickHandlers) {