This commit is contained in:
aPunch 2012-01-28 17:19:45 -06:00
parent cdb89f4572
commit 7a6b80ca58

View File

@ -84,13 +84,10 @@ public class EventListen implements Listener {
@EventHandler
public void onEntityTarget(EntityTargetEvent event) {
if (npcManager.isNPC(event.getTarget()))
if (event.isCancelled() || !npcManager.isNPC(event.getEntity()) || !(event.getTarget() instanceof Player))
return;
if (event.isCancelled() || !npcManager.isNPC(event.getEntity()) || !(event.getTarget() instanceof Player))
return;
NPC npc = npcManager.getNPC(event.getEntity());
if (npc == null)
return;
Player player = (Player) event.getTarget();
if (!npcManager.npcIsSelectedByPlayer(player, npc)) {
if (player.hasPermission("citizens.npc.select")