package pw.hamzantal.bloodmoon.listeners

import hazae41.minecraft.kutils.bukkit.msg
import org.bukkit.block.Sign
import org.bukkit.entity.Player
import org.bukkit.event.entity.EntityDamageEvent
import org.bukkit.event.entity.EntityDamageEvent.DamageCause.FALL
import pw.hamzantal.bloodmoon.specialattacks.dunking

fun onFallDmg(e: EntityDamageEvent) {
    if (!dunking.containsKey(e.entity) || e.cause != FALL) return
    if (e.entity !is Player) return

    val p = e.entity as Player
    val attacker = dunking[p]!!

    dunking.remove(p)

    p.world.createExplosion(p.location, 2F, false)
    attacker.isInvulnerable = false
}