From 3d20f41addfbdd50593390604dcf4b2c50d2635a Mon Sep 17 00:00:00 2001 From: PikaMug <2267126+PikaMug@users.noreply.github.com> Date: Sun, 10 Oct 2021 01:57:26 -0400 Subject: [PATCH] Location obj members must share world, fixes #1813 --- .../main/java/me/blackvein/quests/Quester.java | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/main/src/main/java/me/blackvein/quests/Quester.java b/main/src/main/java/me/blackvein/quests/Quester.java index c501b79a7..e1b187610 100644 --- a/main/src/main/java/me/blackvein/quests/Quester.java +++ b/main/src/main/java/me/blackvein/quests/Quester.java @@ -4081,9 +4081,18 @@ public class Quester implements Comparable { if (!pp.getPlayerUUID().equals(getUUID())) { if (distanceSquared > 0) { final Player player = Bukkit.getPlayer(pp.getPlayerUUID()); - if (player != null && distanceSquared >= getPlayer().getLocation() - .distanceSquared(player.getLocation())) { - mq.add(plugin.getQuester(pp.getPlayerUUID())); + 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()));