mirror of
https://github.com/CitizensDev/Citizens2.git
synced 2024-11-24 11:38:26 +01:00
Use new constructor
This commit is contained in:
parent
f8cec0710f
commit
f3f8fceb6c
@ -90,9 +90,8 @@ public class EventListen implements Listener {
|
|||||||
EntityDamageByEntityEvent e = (EntityDamageByEntityEvent) event;
|
EntityDamageByEntityEvent e = (EntityDamageByEntityEvent) event;
|
||||||
NPC npc = npcManager.getNPC(event.getEntity());
|
NPC npc = npcManager.getNPC(event.getEntity());
|
||||||
|
|
||||||
NPCDamageEvent damageEvent = new NPCDamageEvent(npc, e.getDamager());
|
NPCDamageEvent damageEvent = new NPCDamageEvent(npc, e);
|
||||||
Bukkit.getPluginManager().callEvent(event);
|
Bukkit.getPluginManager().callEvent(event);
|
||||||
event.setCancelled(damageEvent.isCancelled());
|
|
||||||
|
|
||||||
if (!damageEvent.isCancelled() || !(e.getDamager() instanceof Player))
|
if (!damageEvent.isCancelled() || !(e.getDamager() instanceof Player))
|
||||||
return;
|
return;
|
||||||
|
Loading…
Reference in New Issue
Block a user