9
0
mirror of https://github.com/Auxilor/EcoMobs.git synced 2025-12-24 01:19:22 +00:00

Fixed death animation not playing

This commit is contained in:
Will FP
2023-12-27 17:47:55 +01:00
parent 08f8b02d22
commit 9d407b9dea

View File

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