Skip to content

Commit

Permalink
Fix look close bug
Browse files Browse the repository at this point in the history
  • Loading branch information
fullwall committed Feb 29, 2016
1 parent 8441f5a commit ff3d8d6
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/main/java/net/citizensnpcs/trait/LookClose.java
Expand Up @@ -60,11 +60,12 @@ public int compare(Entity o1, Entity o2) {
return Double.compare(d1, d2);
}
});
Location cacheLocation = new Location(null, 0D, 0D, 0D);
for (Entity entity : nearby) {
if (entity.getType() != EntityType.PLAYER || entity.getLocation().getWorld() != npcLocation.getWorld())
if (entity.getType() != EntityType.PLAYER || entity.getLocation(cacheLocation).getWorld() != npcLocation.getWorld())
continue;
if (CitizensAPI.getNPCRegistry().getNPC(entity) != null
|| ((Player) npc.getEntity()).getGameMode() == GameMode.SPECTATOR)
|| ((Player) entity).getGameMode() == GameMode.SPECTATOR)
continue;
lookingAt = (Player) entity;
return;
Expand Down

0 comments on commit ff3d8d6

Please sign in to comment.