mirror of
https://github.com/TotalFreedomMC/TF-ProjectKorra.git
synced 2024-09-11 04:39:32 +00:00
- EntityBendingDeathEvent now triggers when an entity is killed by fire originating from a bending ability
This commit is contained in:
parent
4ac4a2f646
commit
81bcfa9867
|
@ -1,9 +1,14 @@
|
|||
package com.projectkorra.projectkorra.firebending;
|
||||
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.entity.Entity;
|
||||
import org.bukkit.entity.LivingEntity;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
import com.projectkorra.projectkorra.Element;
|
||||
import com.projectkorra.projectkorra.ability.CoreAbility;
|
||||
import com.projectkorra.projectkorra.event.EntityBendingDeathEvent;
|
||||
|
||||
import java.util.concurrent.ConcurrentHashMap;
|
||||
|
||||
public class FireDamageTimer {
|
||||
|
@ -49,6 +54,11 @@ public class FireDamageTimer {
|
|||
}
|
||||
LivingEntity Lentity = (LivingEntity) entity;
|
||||
Player source = INSTANCES.get(entity);
|
||||
if (Lentity.getHealth() - DAMAGE <= 0 && !entity.isDead()) {
|
||||
EntityBendingDeathEvent event = new EntityBendingDeathEvent(entity, source, DAMAGE, CoreAbility.getAbilitiesByElement(Element.FIRE).get(0).getName());
|
||||
Bukkit.getServer().getPluginManager().callEvent(event);
|
||||
}
|
||||
|
||||
Lentity.damage(DAMAGE, source);
|
||||
if (entity.getFireTicks() > MAX_TICKS) {
|
||||
entity.setFireTicks(MAX_TICKS);
|
||||
|
|
Loading…
Reference in a new issue