Skip to content

Commit c7ff994

Browse files
authored
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.
1 parent f09541c commit c7ff994

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

EssentialsChat/src/main/java/com/earth2me/essentials/chat/processing/AbstractChatHandler.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,8 +141,9 @@ protected void handleChatRecipients(AbstractChatEvent event) {
141141

142142
final ChatProcessingCache.Chat chat = cache.getProcessedChat(event.getPlayer());
143143

144-
// If local chat is enabled, handle the recipients here; else we have nothing to do
144+
// If local chat is enabled, handle the recipients here; else we can just fire the chat event and return
145145
if (chat.getRadius() < 1) {
146+
callChatEvent(event, chat.getType(), null);
146147
return;
147148
}
148149
final long radiusSquared = chat.getRadius() * chat.getRadius();

0 commit comments

Comments
 (0)