mirror of
https://github.com/MinecraftForge/MinecraftForge.git
synced 2026-11-25 06:24:43 +00:00
22 lines
1.5 KiB
Diff
22 lines
1.5 KiB
Diff
--- a/net/minecraft/network/chat/PlayerChatMessage.java
|
|
+++ b/net/minecraft/network/chat/PlayerChatMessage.java
|
|
@@ -24,10 +_,17 @@
|
|
}
|
|
}
|
|
|
|
+ // Forge: Bouncer for the version with player context
|
|
public static FilteredText<PlayerChatMessage> m_237223_(FilteredText<Component> p_237224_, FilteredText<Component> p_237225_, MessageSignature p_237226_, boolean p_237227_) {
|
|
+ return filteredSigned(p_237224_, p_237225_, p_237226_, p_237227_, null);
|
|
+ }
|
|
+
|
|
+ public static FilteredText<PlayerChatMessage> filteredSigned(FilteredText<Component> p_237224_, FilteredText<Component> p_237225_, MessageSignature p_237226_, boolean p_237227_, @org.jetbrains.annotations.Nullable ServerPlayer player) {
|
|
Component component = p_237224_.f_215168_();
|
|
Component component1 = p_237225_.f_215168_();
|
|
- PlayerChatMessage playerchatmessage = m_237237_(component, component1, p_237226_, p_237227_);
|
|
+ Component forgeComponent = net.minecraftforge.common.ForgeHooks.onServerChatEvent(player, p_237224_.f_215168_().getString(), component);
|
|
+ // TODO: this overrides the signed ("normal") component from the player, but ignores the unsigned component. What do we do here? This is a mess. -C
|
|
+ PlayerChatMessage playerchatmessage = m_237237_(forgeComponent, component1, p_237226_, p_237227_);
|
|
if (p_237225_.m_215174_()) {
|
|
PlayerChatMessage playerchatmessage1 = Util.m_214614_(p_237225_.f_215169_(), PlayerChatMessage::m_237235_);
|
|
return new FilteredText<>(playerchatmessage, playerchatmessage1);
|