This commit is contained in:
aPunch 2012-01-28 17:19:45 -06:00
parent 922cf2444b
commit b85a378a7d

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")