mirror of
https://github.com/TotalFreedomMC/TF-ProjectKorra.git
synced 2024-09-11 04:39:32 +00:00
Merge pull request #404 from savior67/master
- EntityBendingDeathEvent now triggers from fire-related deaths
This commit is contained in:
commit
b701c86387
|
@ -1,9 +1,14 @@
|
||||||
package com.projectkorra.projectkorra.firebending;
|
package com.projectkorra.projectkorra.firebending;
|
||||||
|
|
||||||
|
import org.bukkit.Bukkit;
|
||||||
import org.bukkit.entity.Entity;
|
import org.bukkit.entity.Entity;
|
||||||
import org.bukkit.entity.LivingEntity;
|
import org.bukkit.entity.LivingEntity;
|
||||||
import org.bukkit.entity.Player;
|
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;
|
import java.util.concurrent.ConcurrentHashMap;
|
||||||
|
|
||||||
public class FireDamageTimer {
|
public class FireDamageTimer {
|
||||||
|
@ -49,6 +54,11 @@ public class FireDamageTimer {
|
||||||
}
|
}
|
||||||
LivingEntity Lentity = (LivingEntity) entity;
|
LivingEntity Lentity = (LivingEntity) entity;
|
||||||
Player source = INSTANCES.get(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);
|
Lentity.damage(DAMAGE, source);
|
||||||
if (entity.getFireTicks() > MAX_TICKS) {
|
if (entity.getFireTicks() > MAX_TICKS) {
|
||||||
entity.setFireTicks(MAX_TICKS);
|
entity.setFireTicks(MAX_TICKS);
|
||||||
|
|
Loading…
Reference in a new issue