package pw.hamzantal.bloodmoon.listeners

import org.bukkit.event.entity.EntityDeathEvent
import pw.hamzantal.bloodmoon.BMData

fun onDeath(e: EntityDeathEvent) {
    if (BMData.creepers.contains(e.entity)) {
        BMData.creepers.remove(e.entity)
        return
    }

    val d = BMData.transformed.keys.firstOrNull { it.entity == e.entity } ?: return
    d.stopDisguise()
    BMData.transformed.remove(d)
}