Remove dead code (LegacyResult) (#10411)

* Stop firing AsyncPlayerChatPreviewEvent as chat preview was removed in 1.19.3. This is in parity with upstream

* formatting and small tweaks

* correctly set MESSAGE_CHANGED flag for modern modifications

---------

Co-authored-by: Jake Potrebic <jake.m.potrebic@gmail.com>
This commit is contained in:
brickmonster
2024-04-19 20:47:24 +01:00
parent 76be2651ca
commit 07e8f74355
4 changed files with 103 additions and 295 deletions

View File

@@ -68,7 +68,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ if (msg.startsWith("/")) {
+ this.getHandle().connection.handleCommand(msg);
+ } else {
+ final PlayerChatMessage playerChatMessage = PlayerChatMessage.system(msg).withResult(new net.minecraft.network.chat.ChatDecorator.ModernResult(Component.literal(msg), true, false));
+ final PlayerChatMessage playerChatMessage = PlayerChatMessage.system(msg).withUnsignedContent(Component.literal(msg));
+ // TODO chat decorating
+ // TODO text filtering
+ this.getHandle().connection.chat(msg, playerChatMessage, false);