From 6cf0cc08c5510f10fa52fae2974391ab40f042b6 Mon Sep 17 00:00:00 2001 From: fullwall Date: Thu, 16 Aug 2012 00:13:46 +0800 Subject: [PATCH] Implement NPCDamageByBlockEvent --- src/main/java/net/citizensnpcs/EventListen.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/main/java/net/citizensnpcs/EventListen.java b/src/main/java/net/citizensnpcs/EventListen.java index f61781b88..49eb3bed1 100644 --- a/src/main/java/net/citizensnpcs/EventListen.java +++ b/src/main/java/net/citizensnpcs/EventListen.java @@ -1,6 +1,7 @@ package net.citizensnpcs; import net.citizensnpcs.api.CitizensAPI; +import net.citizensnpcs.api.event.NPCDamageByBlockEvent; import net.citizensnpcs.api.event.NPCDamageByEntityEvent; import net.citizensnpcs.api.event.NPCDamageEvent; import net.citizensnpcs.api.event.NPCLeftClickEvent; @@ -20,6 +21,7 @@ import org.bukkit.craftbukkit.entity.CraftPlayer; import org.bukkit.entity.Player; import org.bukkit.event.EventHandler; import org.bukkit.event.Listener; +import org.bukkit.event.entity.EntityDamageByBlockEvent; import org.bukkit.event.entity.EntityDamageByEntityEvent; import org.bukkit.event.entity.EntityDamageEvent; import org.bukkit.event.entity.EntityDeathEvent; @@ -92,6 +94,9 @@ public class EventListen implements Listener { // Call left-click event NPCLeftClickEvent leftClickEvent = new NPCLeftClickEvent(npc, damager); Bukkit.getPluginManager().callEvent(leftClickEvent); + } else if (event instanceof EntityDamageByBlockEvent) { + Bukkit.getPluginManager().callEvent( + new NPCDamageByBlockEvent(npc, (EntityDamageByBlockEvent) event)); } else { Bukkit.getPluginManager().callEvent(new NPCDamageEvent(npc, event)); }