mirror of
https://github.com/CitizensDev/Citizens2.git
synced 2025-02-16 12:21:25 +01:00
Fix incorrectly inverted canSee check breaking getNearbyPlayers
This commit is contained in:
parent
4090a625e9
commit
45fff0f420
@ -530,8 +530,9 @@ public class NMS {
|
||||
private static Collection<Player> getNearbyPlayers(Entity from, Location location, double radius) {
|
||||
List<Player> players = Lists.newArrayList();
|
||||
for (Player player : CitizensAPI.getLocationLookup().getNearbyPlayers(location, radius)) {
|
||||
if (location.getWorld() != player.getWorld() || from != null && Util.canSee(player, from)
|
||||
|| location.distance(player.getLocation()) > radius)
|
||||
if (location.getWorld() != player.getWorld() || location.distance(player.getLocation()) > radius)
|
||||
continue;
|
||||
if (from != null && !Util.canSee(player, from))
|
||||
continue;
|
||||
|
||||
players.add(player);
|
||||
|
@ -106,9 +106,9 @@ public class Util {
|
||||
}
|
||||
|
||||
public static boolean canSee(Player player, Entity from) {
|
||||
if (from instanceof Player) {
|
||||
if (from instanceof Player)
|
||||
return player.canSee((Player) from);
|
||||
}
|
||||
|
||||
if (SUPPORTS_ENTITY_CANSEE) {
|
||||
try {
|
||||
return player.canSee(from);
|
||||
|
Loading…
Reference in New Issue
Block a user