Location obj members must share world, fixes #1813

This commit is contained in:
PikaMug 2021-10-10 01:57:26 -04:00
parent 523da1cf19
commit 3d20f41add

View File

@ -4081,9 +4081,18 @@ public class Quester implements Comparable<Quester> {
if (!pp.getPlayerUUID().equals(getUUID())) { if (!pp.getPlayerUUID().equals(getUUID())) {
if (distanceSquared > 0) { if (distanceSquared > 0) {
final Player player = Bukkit.getPlayer(pp.getPlayerUUID()); final Player player = Bukkit.getPlayer(pp.getPlayerUUID());
if (player != null && distanceSquared >= getPlayer().getLocation() if (player != null) {
.distanceSquared(player.getLocation())) { final Location locationOne = getPlayer().getLocation();
mq.add(plugin.getQuester(pp.getPlayerUUID())); final Location locationTwo = player.getLocation();
if (locationOne.getWorld() != null && locationTwo.getWorld() != null) {
if (locationOne.getWorld().getName().equals(locationTwo.getWorld()
.getName())) {
if (distanceSquared >= getPlayer().getLocation()
.distanceSquared(player.getLocation())) {
mq.add(plugin.getQuester(pp.getPlayerUUID()));
}
}
}
} }
} else { } else {
mq.add(plugin.getQuester(pp.getPlayerUUID())); mq.add(plugin.getQuester(pp.getPlayerUUID()));