diff options
author | Cow <cow@volloeko.de> | 2022-10-10 23:33:18 +0200 |
---|---|---|
committer | Cow <cow@volloeko.de> | 2022-10-10 23:33:18 +0200 |
commit | a71f878644e48189b064a59864ee6c32a64bbed8 (patch) | |
tree | ee8a53a14f161ed41775866da81b26cc143bb197 | |
parent | 307610afe9a46e1e5ad57b6c1bcbbe2fa5e6747f (diff) | |
download | Cowlection-a71f878644e48189b064a59864ee6c32a64bbed8.tar.gz Cowlection-a71f878644e48189b064a59864ee6c32a64bbed8.tar.bz2 Cowlection-a71f878644e48189b064a59864ee6c32a64bbed8.zip |
Removed `ClientChatReceivedEvent` when sending mod-internal chat messages
-rw-r--r-- | CHANGELOG.md | 1 | ||||
-rw-r--r-- | src/main/java/de/cowtipper/cowlection/util/ChatHelper.java | 7 |
2 files changed, 2 insertions, 6 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md index f398963..328df89 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -26,6 +26,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). - `/moo search`: Allow empty search query (= returns all log entries between start and end date) - `/moo stalkskyblock`: replaced "last played" with "last time *someone* played on the selected profile" +- (technical change: no longer fire `ClientChatReceivedEvent` when sending a mod-internal chat message, as too many other mods have had problems with it) ### Fixed diff --git a/src/main/java/de/cowtipper/cowlection/util/ChatHelper.java b/src/main/java/de/cowtipper/cowlection/util/ChatHelper.java index eef9ca7..670f1ee 100644 --- a/src/main/java/de/cowtipper/cowlection/util/ChatHelper.java +++ b/src/main/java/de/cowtipper/cowlection/util/ChatHelper.java @@ -6,7 +6,6 @@ import net.minecraft.util.ChatComponentText; import net.minecraft.util.ChatStyle; import net.minecraft.util.EnumChatFormatting; import net.minecraft.util.IChatComponent; -import net.minecraftforge.client.event.ClientChatReceivedEvent; import net.minecraftforge.common.MinecraftForge; import net.minecraftforge.event.entity.EntityJoinWorldEvent; import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; @@ -34,11 +33,7 @@ public class ChatHelper { if (Minecraft.getMinecraft().thePlayer == null) { putOfflineMessage(chatComponent); } else { - ClientChatReceivedEvent event = new ClientChatReceivedEvent((byte) 1, chatComponent); - MinecraftForge.EVENT_BUS.post(event); - if (!event.isCanceled()) { - Minecraft.getMinecraft().thePlayer.addChatMessage(event.message); - } + Minecraft.getMinecraft().thePlayer.addChatMessage(chatComponent); } } |