mirror of
https://github.com/CitizensDev/Citizens2.git
synced 2025-01-14 04:02:01 +01:00
Fix look close bug
This commit is contained in:
parent
fcf9fae805
commit
589c58ae36
@ -60,11 +60,12 @@ public class LookClose extends Trait implements Toggleable, CommandConfigurable
|
||||
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;
|
||||
|
Loading…
Reference in New Issue
Block a user