Skip to content

Commit e8dda63

Browse files
authored
Merge pull request #226 from M0diis/resolve-223
Resolve #223
2 parents 189214f + aa99703 commit e8dda63

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

plugin/src/main/java/at/helpch/chatchat/util/ChannelUtils.java

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
import at.helpch.chatchat.api.user.User;
66
import at.helpch.chatchat.channel.ChatChannel;
77
import org.bukkit.Location;
8+
import org.bukkit.World;
89
import org.jetbrains.annotations.NotNull;
910

1011
import 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

0 commit comments

Comments
 (0)