mirror of
https://github.com/CitizensDev/Citizens2.git
synced 2024-11-27 05:05:20 +01:00
Fix distance calcuation bug
This commit is contained in:
parent
ad46c38ebe
commit
38ab44b55e
@ -299,6 +299,7 @@ public class EventListen implements Listener {
|
||||
for (NPC npc : getAllNPCs()) {
|
||||
Entity npcEntity = npc.getEntity();
|
||||
if (npcEntity instanceof Player && player.canSee((Player) npcEntity)
|
||||
&& player.getWorld().equals(npcEntity.getWorld())
|
||||
&& player.getLocation().distanceSquared(npcEntity.getLocation()) < 100 * 100) {
|
||||
nearbyNPCs.add(((CraftPlayer) npcEntity).getHandle());
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user