mirror of
https://github.com/CitizensDev/Citizens2.git
synced 2024-11-24 11:38:26 +01:00
Fix typo
This commit is contained in:
parent
4cd729ae20
commit
41ddb6851b
@ -89,14 +89,12 @@ public class EventListen implements Listener {
|
|||||||
|
|
||||||
NPC npc = npcManager.getNPC(event.getEntity());
|
NPC npc = npcManager.getNPC(event.getEntity());
|
||||||
if (event instanceof EntityDamageByEntityEvent) {
|
if (event instanceof EntityDamageByEntityEvent) {
|
||||||
EntityDamageByEntityEvent e = (EntityDamageByEntityEvent) event;
|
NPCDamageByEntityEvent damageEvent = new NPCDamageByEntityEvent(npc, (EntityDamageByEntityEvent) event);
|
||||||
|
Bukkit.getPluginManager().callEvent(damageEvent);
|
||||||
|
|
||||||
NPCDamageByEntityEvent damageEvent = new NPCDamageByEntityEvent(npc, e);
|
if (!damageEvent.isCancelled() || !(damageEvent.getDamager() instanceof Player))
|
||||||
Bukkit.getPluginManager().callEvent(event);
|
|
||||||
|
|
||||||
if (!damageEvent.isCancelled() || !(e.getDamager() instanceof Player))
|
|
||||||
return;
|
return;
|
||||||
Player damager = (Player) e.getDamager();
|
Player damager = (Player) damageEvent.getDamager();
|
||||||
|
|
||||||
// Call left-click event
|
// Call left-click event
|
||||||
NPCLeftClickEvent leftClickEvent = new NPCLeftClickEvent(npc, damager);
|
NPCLeftClickEvent leftClickEvent = new NPCLeftClickEvent(npc, damager);
|
||||||
|
Loading…
Reference in New Issue
Block a user