diff --git a/src/main/java/org/itqop/chatit/handlers/ChatEventHandler.java b/src/main/java/org/itqop/chatit/handlers/ChatEventHandler.java index a10fb15..a0db127 100644 --- a/src/main/java/org/itqop/chatit/handlers/ChatEventHandler.java +++ b/src/main/java/org/itqop/chatit/handlers/ChatEventHandler.java @@ -49,13 +49,8 @@ public class ChatEventHandler { if (profanityScore > threshold && !PlayerConfigManager.hasAdultContentEnabled(receiver)) { continue; } - - try (var senderLevel = sender.level(); var receiverLevel = receiver.level()) { - if (isGlobal || (receiverLevel == senderLevel && receiver.position().distanceTo(sender.position()) <= 50)) { - receiver.sendSystemMessage(chatComponent); - } - } catch (Exception e) { - e.printStackTrace(); + if (isGlobal || (receiver.getCommandSenderWorld() == sender.getCommandSenderWorld() && receiver.position().distanceTo(sender.position()) <= 50)) { + receiver.sendSystemMessage(chatComponent); } } }