From dbdd6c9ac4ba1be7c91f758510ffe0f55cd15c72 Mon Sep 17 00:00:00 2001 From: itqop Date: Mon, 21 Oct 2024 17:27:06 +0300 Subject: [PATCH] Fix tick timeout --- .../java/org/itqop/chatit/handlers/ChatEventHandler.java | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) 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); } } }