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,10 +4081,19 @@ public class Quester implements Comparable<Quester> {
if (!pp.getPlayerUUID().equals(getUUID())) {
if (distanceSquared > 0) {
final Player player = Bukkit.getPlayer(pp.getPlayerUUID());
if (player != null && distanceSquared >= getPlayer().getLocation()
if (player != null) {
final Location locationOne = getPlayer().getLocation();
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 {
mq.add(plugin.getQuester(pp.getPlayerUUID()));
}