mirror of
https://github.com/CitizensDev/Citizens2.git
synced 2024-11-05 02:10:10 +01:00
Comparison should be squared
This commit is contained in:
parent
58443ee726
commit
8c0fa7cd17
@ -79,7 +79,7 @@ public class LookClose extends Trait implements Toggleable, CommandConfigurable
|
||||
if (location.getWorld() != NPC_LOCATION.getWorld())
|
||||
continue;
|
||||
double dist = location.distanceSquared(NPC_LOCATION);
|
||||
if (dist > range || CitizensAPI.getNPCRegistry().getNPC(entity) != null || isInvisible(player))
|
||||
if (dist > range * range || CitizensAPI.getNPCRegistry().getNPC(entity) != null || isInvisible(player))
|
||||
continue;
|
||||
nearby.add(player);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user