Fire GlobalChatEvent even when local chat is disabled (#6113)

This allows EssentialsX Discord to send EssentialsX Chat messages to
Discord when `use-essentials-events: true` is set in the Discord config
while local chat is disabled.

It also allows plugins to hook and modify EssentialsX Chat message
contents, formatting and recipients when local chat is disabled.
This commit is contained in:
MD 2025-03-30 23:04:56 +01:00 committed by GitHub
parent f09541cfa6
commit c7ff994d18
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -141,8 +141,9 @@ public abstract class AbstractChatHandler {
final ChatProcessingCache.Chat chat = cache.getProcessedChat(event.getPlayer());
// If local chat is enabled, handle the recipients here; else we have nothing to do
// If local chat is enabled, handle the recipients here; else we can just fire the chat event and return
if (chat.getRadius() < 1) {
callChatEvent(event, chat.getType(), null);
return;
}
final long radiusSquared = chat.getRadius() * chat.getRadius();