File tree Expand file tree Collapse file tree
plugin/src/main/java/at/helpch/chatchat/util Expand file tree Collapse file tree Original file line number Diff line number Diff line change 55import at .helpch .chatchat .api .user .User ;
66import at .helpch .chatchat .channel .ChatChannel ;
77import org .bukkit .Location ;
8+ import org .bukkit .World ;
89import org .jetbrains .annotations .NotNull ;
910
1011import java .util .List ;
@@ -53,6 +54,14 @@ public static boolean isTargetWithinRadius(
5354 if (radius != -1 && source instanceof ChatUser ) {
5455 final Location sourceLocation = ((ChatUser ) source ).player ().getLocation ();
5556 final Location targetLocation = ((ChatUser ) target ).player ().getLocation ();
57+
58+ final World sourceWorld = sourceLocation .getWorld ();
59+ final World targetWorld = targetLocation .getWorld ();
60+
61+ if (sourceWorld != null && targetWorld != null && !sourceWorld .getUID ().equals (targetWorld .getUID ())) {
62+ return false ;
63+ }
64+
5665 final int relativeX = targetLocation .getBlockX () - sourceLocation .getBlockX ();
5766 final int relativeZ = targetLocation .getBlockZ () - sourceLocation .getBlockZ ();
5867
You can’t perform that action at this time.
0 commit comments