Fix tick timeout

This commit is contained in:
itqop 2024-10-21 17:27:06 +03:00
parent c5feae6512
commit dbdd6c9ac4
1 changed files with 2 additions and 7 deletions

View File

@ -49,14 +49,9 @@ public class ChatEventHandler {
if (profanityScore > threshold && !PlayerConfigManager.hasAdultContentEnabled(receiver)) { if (profanityScore > threshold && !PlayerConfigManager.hasAdultContentEnabled(receiver)) {
continue; continue;
} }
if (isGlobal || (receiver.getCommandSenderWorld() == sender.getCommandSenderWorld() && receiver.position().distanceTo(sender.position()) <= 50)) {
try (var senderLevel = sender.level(); var receiverLevel = receiver.level()) {
if (isGlobal || (receiverLevel == senderLevel && receiver.position().distanceTo(sender.position()) <= 50)) {
receiver.sendSystemMessage(chatComponent); receiver.sendSystemMessage(chatComponent);
} }
} catch (Exception e) {
e.printStackTrace();
}
} }
} }
}); });