11/*
22 * This file is part of adventure-platform-mod, licensed under the MIT License.
33 *
4- * Copyright (c) 2020-2025 KyoriPowered
4+ * Copyright (c) 2020-2026 KyoriPowered
55 *
66 * Permission is hereby granted, free of charge, to any person obtaining a copy
77 * of this software and associated documentation files (the "Software"), to deal
5151import net .kyori .adventure .text .Component ;
5252import net .kyori .adventure .title .Title ;
5353import net .kyori .adventure .title .TitlePart ;
54- import net .minecraft .client .GuiMessageTag ;
5554import net .minecraft .client .Minecraft ;
5655import net .minecraft .client .gui .screens .inventory .BookViewScreen ;
56+ import net .minecraft .client .multiplayer .chat .GuiMessageTag ;
5757import net .minecraft .client .player .LocalPlayer ;
5858import net .minecraft .client .resources .sounds .EntityBoundSoundInstance ;
5959import net .minecraft .client .resources .sounds .SimpleSoundInstance ;
@@ -84,7 +84,7 @@ public ClientAudience(final Minecraft client, final MinecraftClientAudiencesImpl
8484
8585 @ Override
8686 public void sendMessage (final @ NotNull Component message ) {
87- this .client .gui .getChat ().addMessage (this .controller .asNative (message ));
87+ this .client .gui .getChat ().addClientSystemMessage (this .controller .asNative (message ));
8888 }
8989
9090 private net .minecraft .network .chat .ChatType .Bound toMc (final ChatType .Bound bound ) {
@@ -94,15 +94,19 @@ private net.minecraft.network.chat.ChatType.Bound toMc(final ChatType.Bound boun
9494 @ Override
9595 public void sendMessage (final @ NotNull Component message , final ChatType .@ NotNull Bound boundChatType ) {
9696 final net .minecraft .network .chat .ChatType .Bound bound = this .toMc (boundChatType );
97- this .client .gui .getChat ().addMessage (bound .decorate (this .controller .asNative (message )), null , GuiMessageTag .chatNotSecure ());
97+ this .client .gui .getChat ().addPlayerMessage (bound .decorate (this .controller .asNative (message )), null , GuiMessageTag .chatNotSecure ());
9898 }
9999
100100 @ Override
101101 public void sendMessage (final @ NotNull SignedMessage signedMessage , final ChatType .@ NotNull Bound boundChatType ) {
102102 final net .minecraft .network .chat .ChatType .Bound bound = this .toMc (boundChatType );
103103 final Component message = Objects .requireNonNullElse (signedMessage .unsignedContent (), Component .text (signedMessage .message ()));
104104
105- this .client .gui .getChat ().addMessage (bound .decorate (this .controller .asNative (message )), (MessageSignature ) (Object ) signedMessage .signature (), this .tag (signedMessage ));
105+ this .client .gui .getChat ().addPlayerMessage (
106+ bound .decorate (this .controller .asNative (message )),
107+ (MessageSignature ) (Object ) signedMessage .signature (),
108+ this .tag (signedMessage )
109+ );
106110 }
107111
108112 private GuiMessageTag tag (final SignedMessage message ) {
@@ -135,12 +139,12 @@ public void sendMessage(final Identity source, final @NotNull Component message,
135139 if (type == MessageType .CHAT ) {
136140 // Add to chat queue (following delay and such)
137141 if (visibility == ChatVisiblity .FULL ) {
138- this .client .gui .getChat ().addMessage (this .controller .asNative (message ), null , null );
142+ this .client .gui .getChat ().addPlayerMessage (this .controller .asNative (message ), null , null );
139143 }
140144 } else {
141145 // Add immediately as a system message
142146 if (visibility == ChatVisiblity .FULL || visibility == ChatVisiblity .SYSTEM ) {
143- this .client .gui .getChat ().addMessage (this .controller .asNative (message ));
147+ this .client .gui .getChat ().addClientSystemMessage (this .controller .asNative (message ));
144148 }
145149 }
146150 }
@@ -215,7 +219,7 @@ private long seed(final @NotNull Sound sound) {
215219 } else {
216220 final @ Nullable LocalPlayer player = this .client .player ;
217221 if (player != null ) {
218- return ((LevelAccess ) player .level ()).accessor$threadSafeRandom ().nextLong ();
222+ return ((LevelAccess ) player .level ()).accessor$soundSeedGenerator ().nextLong ();
219223 } else {
220224 return 0l ;
221225 }
0 commit comments