Class MessageHandler
java.lang.Object
net.minecraft.client.network.message.MessageHandler
Handles received messages, including chat messages and game messages.
- Mappings:
- Namespace - Name - named - net/minecraft/client/network/message/MessageHandler- intermediary - net/minecraft/class_7594- official - gmi
- 
Nested Class SummaryNested ClassesModifier and TypeClassDescriptionprivate static final recordA message to be processed.
- 
Field SummaryFieldsModifier and TypeFieldDescriptionprivate longprivate final MinecraftClientprivate final Deque<MessageHandler.ProcessableMessage> private longprivate static final Text
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionprivate voidaddToChatLog(SignedMessage message, MessageType.Parameters params, com.mojang.authlib.GameProfile sender, MessageTrustStatus trustStatus) private voidaddToChatLog(Text message, Instant timestamp) private UUIDextractSender(Text text) private MessageTrustStatusgetStatus(SignedMessage message, Text decorated, Instant receptionTimestamp) Returns the trust status ofmessage.longReturns the number of delayed messages that are not processed yet.private booleanisAlwaysTrusted(UUID sender) Returns whether messages fromsenderare always trusted.private voidnarrate(MessageType.Parameters params, Text message) Narratesmessage.voidonChatMessage(SignedMessage message, com.mojang.authlib.GameProfile sender, MessageType.Parameters params) voidonGameMessage(Text message, boolean overlay) Called when a game message is received.voidonProfilelessMessage(Text content, MessageType.Parameters params) voidonUnverifiedMessage(UUID sender, @Nullable MessageSignatureData signature, MessageType.Parameters parameters) voidprocess()Processes one delayed message from the queue's beginning.private voidprocess(@Nullable MessageSignatureData signature, BooleanSupplier processor) Queuesprocessorduring the chat delay, otherwise runs the processor.voidProcesses all delayed messages from the queue.private booleanprocessChatMessageInternal(MessageType.Parameters params, SignedMessage message, Text decorated, com.mojang.authlib.GameProfile sender, boolean onlyShowSecureChat, Instant receptionTimestamp) Processes a chat message.voidProcesses all delayed messages until one of them fails to process if the delay has passed, and otherwise does nothing.booleanremoveDelayedMessage(MessageSignatureData signature) Removes a delayed message whose signature matchessignature.voidsetChatDelay(double chatDelay) Sets the chat delay tochatDelayseconds.private booleanReturns if the chat delay is set and the message should be delayed.
- 
Field Details- 
VALIDATION_ERROR_TEXT- Mappings:
- Namespace - Name - Mixin selector - named - VALIDATION_ERROR_TEXT- Lnet/minecraft/client/network/message/MessageHandler;VALIDATION_ERROR_TEXT:Lnet/minecraft/text/Text;- intermediary - field_45950- Lnet/minecraft/class_7594;field_45950:Lnet/minecraft/class_2561;- official - a- Lgmi;a:Lxg;
 
- 
client- Mappings:
- Namespace - Name - Mixin selector - named - client- Lnet/minecraft/client/network/message/MessageHandler;client:Lnet/minecraft/client/MinecraftClient;- intermediary - field_39779- Lnet/minecraft/class_7594;field_39779:Lnet/minecraft/class_310;- official - b- Lgmi;b:Lfqq;
 
- 
delayedMessages- Mappings:
- Namespace - Name - Mixin selector - named - delayedMessages- Lnet/minecraft/client/network/message/MessageHandler;delayedMessages:Ljava/util/Deque;- intermediary - field_39796- Lnet/minecraft/class_7594;field_39796:Ljava/util/Deque;- official - c- Lgmi;c:Ljava/util/Deque;
 
- 
chatDelayprivate long chatDelay- Mappings:
- Namespace - Name - Mixin selector - named - chatDelay- Lnet/minecraft/client/network/message/MessageHandler;chatDelay:J- intermediary - field_39797- Lnet/minecraft/class_7594;field_39797:J- official - d- Lgmi;d:J
 
- 
lastProcessTimeprivate long lastProcessTime- Mappings:
- Namespace - Name - Mixin selector - named - lastProcessTime- Lnet/minecraft/client/network/message/MessageHandler;lastProcessTime:J- intermediary - field_39798- Lnet/minecraft/class_7594;field_39798:J- official - e- Lgmi;e:J
 
 
- 
- 
Constructor Details- 
MessageHandler- Mappings:
- Namespace - Name - Mixin selector - named - <init>- Lnet/minecraft/client/network/message/MessageHandler;<init>(Lnet/minecraft/client/MinecraftClient;)V- intermediary - <init>- Lnet/minecraft/class_7594;<init>(Lnet/minecraft/class_310;)V- official - <init>- Lgmi;<init>(Lfqq;)V
 
 
- 
- 
Method Details- 
processDelayedMessagespublic void processDelayedMessages()Processes all delayed messages until one of them fails to process if the delay has passed, and otherwise does nothing.- Mappings:
- Namespace - Name - Mixin selector - named - processDelayedMessages- Lnet/minecraft/client/network/message/MessageHandler;processDelayedMessages()V- intermediary - method_44765- Lnet/minecraft/class_7594;method_44765()V- official - a- Lgmi;a()V
 
- 
setChatDelaypublic void setChatDelay(double chatDelay) Sets the chat delay tochatDelayseconds. If the chat delay was changed to0, this also processes all queued messages.- Mappings:
- Namespace - Name - Mixin selector - named - setChatDelay- Lnet/minecraft/client/network/message/MessageHandler;setChatDelay(D)V- intermediary - method_44766- Lnet/minecraft/class_7594;method_44766(D)V- official - a- Lgmi;a(D)V
 
- 
processpublic void process()Processes one delayed message from the queue's beginning.- Mappings:
- Namespace - Name - Mixin selector - named - process- Lnet/minecraft/client/network/message/MessageHandler;process()V- intermediary - method_44769- Lnet/minecraft/class_7594;method_44769()V- official - b- Lgmi;b()V
 
- 
getUnprocessedMessageCountpublic long getUnprocessedMessageCount()Returns the number of delayed messages that are not processed yet.- Returns:
- the number of delayed messages that are not processed yet
- Mappings:
- Namespace - Name - Mixin selector - named - getUnprocessedMessageCount- Lnet/minecraft/client/network/message/MessageHandler;getUnprocessedMessageCount()J- intermediary - method_44944- Lnet/minecraft/class_7594;method_44944()J- official - c- Lgmi;c()J
 
- 
processAllpublic void processAll()Processes all delayed messages from the queue.- Mappings:
- Namespace - Name - Mixin selector - named - processAll- Lnet/minecraft/client/network/message/MessageHandler;processAll()V- intermediary - method_44945- Lnet/minecraft/class_7594;method_44945()V- official - d- Lgmi;d()V
 
- 
removeDelayedMessageRemoves a delayed message whose signature matchessignature. If this returnsfalse, either the message is not received or it it already on the hud.- Returns:
- whether the message was removed
- Mappings:
- Namespace - Name - Mixin selector - named - removeDelayedMessage- Lnet/minecraft/client/network/message/MessageHandler;removeDelayedMessage(Lnet/minecraft/network/message/MessageSignatureData;)Z- intermediary - method_44819- Lnet/minecraft/class_7594;method_44819(Lnet/minecraft/class_7469;)Z- official - a- Lgmi;a(Lxs;)Z
 
- 
shouldDelayprivate boolean shouldDelay()Returns if the chat delay is set and the message should be delayed.- Returns:
- if the chat delay is set and the message should be delayed
- Mappings:
- Namespace - Name - Mixin selector - named - shouldDelay- Lnet/minecraft/client/network/message/MessageHandler;shouldDelay()Z- intermediary - method_44775- Lnet/minecraft/class_7594;method_44775()Z- official - e- Lgmi;e()Z
 
- 
processQueuesprocessorduring the chat delay, otherwise runs the processor.- Mappings:
- Namespace - Name - Mixin selector - named - process- Lnet/minecraft/client/network/message/MessageHandler;process(Lnet/minecraft/network/message/MessageSignatureData;Ljava/util/function/BooleanSupplier;)V- intermediary - method_44818- Lnet/minecraft/class_7594;method_44818(Lnet/minecraft/class_7469;Ljava/util/function/BooleanSupplier;)V- official - a- Lgmi;a(Lxs;Ljava/util/function/BooleanSupplier;)V
 
- 
onChatMessagepublic void onChatMessage(SignedMessage message, com.mojang.authlib.GameProfile sender, MessageType.Parameters params) - Mappings:
- Namespace - Name - Mixin selector - named - onChatMessage- Lnet/minecraft/client/network/message/MessageHandler;onChatMessage(Lnet/minecraft/network/message/SignedMessage;Lcom/mojang/authlib/GameProfile;Lnet/minecraft/network/message/MessageType$Parameters;)V- intermediary - method_45748- Lnet/minecraft/class_7594;method_45748(Lnet/minecraft/class_7471;Lcom/mojang/authlib/GameProfile;Lnet/minecraft/class_2556$class_7602;)V- official - a- Lgmi;a(Lxw;Lcom/mojang/authlib/GameProfile;Lxc$a;)V
 
- 
onUnverifiedMessagepublic void onUnverifiedMessage(UUID sender, @Nullable @Nullable MessageSignatureData signature, MessageType.Parameters parameters) - Mappings:
- Namespace - Name - Mixin selector - named - onUnverifiedMessage- Lnet/minecraft/client/network/message/MessageHandler;onUnverifiedMessage(Ljava/util/UUID;Lnet/minecraft/network/message/MessageSignatureData;Lnet/minecraft/network/message/MessageType$Parameters;)V- intermediary - method_53488- Lnet/minecraft/class_7594;method_53488(Ljava/util/UUID;Lnet/minecraft/class_7469;Lnet/minecraft/class_2556$class_7602;)V- official - a- Lgmi;a(Ljava/util/UUID;Lxs;Lxc$a;)V
 
- 
onProfilelessMessage- Mappings:
- Namespace - Name - Mixin selector - named - onProfilelessMessage- Lnet/minecraft/client/network/message/MessageHandler;onProfilelessMessage(Lnet/minecraft/text/Text;Lnet/minecraft/network/message/MessageType$Parameters;)V- intermediary - method_45746- Lnet/minecraft/class_7594;method_45746(Lnet/minecraft/class_2561;Lnet/minecraft/class_2556$class_7602;)V- official - a- Lgmi;a(Lxg;Lxc$a;)V
 
- 
processChatMessageInternalprivate boolean processChatMessageInternal(MessageType.Parameters params, SignedMessage message, Text decorated, com.mojang.authlib.GameProfile sender, boolean onlyShowSecureChat, Instant receptionTimestamp) Processes a chat message.If the message cannot be verified due to a broken chain, this disconnects the client from the server. The message can still end up not being displayed if the verification fails and onlyShowSecureChatistrueor if the sender is blocked via the social interactions screen.This adds the message to the hud, narrates it, and appends it to the chat log. - Parameters:
- receptionTimestamp- the timestamp when the message was received by this client
- Returns:
- whether the message was actually displayed
- Mappings:
- Namespace - Name - Mixin selector - named - processChatMessageInternal- Lnet/minecraft/client/network/message/MessageHandler;processChatMessageInternal(Lnet/minecraft/network/message/MessageType$Parameters;Lnet/minecraft/network/message/SignedMessage;Lnet/minecraft/text/Text;Lcom/mojang/authlib/GameProfile;ZLjava/time/Instant;)Z- intermediary - method_44943- Lnet/minecraft/class_7594;method_44943(Lnet/minecraft/class_2556$class_7602;Lnet/minecraft/class_7471;Lnet/minecraft/class_2561;Lcom/mojang/authlib/GameProfile;ZLjava/time/Instant;)Z- official - a- Lgmi;a(Lxc$a;Lxw;Lxg;Lcom/mojang/authlib/GameProfile;ZLjava/time/Instant;)Z
 
- 
narrateNarratesmessage.- See Also:
- Mappings:
- Namespace - Name - Mixin selector - named - narrate- Lnet/minecraft/client/network/message/MessageHandler;narrate(Lnet/minecraft/network/message/MessageType$Parameters;Lnet/minecraft/text/Text;)V- intermediary - method_44772- Lnet/minecraft/class_7594;method_44772(Lnet/minecraft/class_2556$class_7602;Lnet/minecraft/class_2561;)V- official - a- Lgmi;a(Lxc$a;Lxg;)V
 
- 
getStatusprivate MessageTrustStatus getStatus(SignedMessage message, Text decorated, Instant receptionTimestamp) Returns the trust status ofmessage.This returns MessageTrustStatus.SECUREfor messages that are considered to be always trusted.- Returns:
- the trust status of message
- See Also:
- Mappings:
- Namespace - Name - Mixin selector - named - getStatus- Lnet/minecraft/client/network/message/MessageHandler;getStatus(Lnet/minecraft/network/message/SignedMessage;Lnet/minecraft/text/Text;Ljava/time/Instant;)Lnet/minecraft/client/network/message/MessageTrustStatus;- intermediary - method_44732- Lnet/minecraft/class_7594;method_44732(Lnet/minecraft/class_7471;Lnet/minecraft/class_2561;Ljava/time/Instant;)Lnet/minecraft/class_7595;- official - a- Lgmi;a(Lxw;Lxg;Ljava/time/Instant;)Lgmk;
 
- 
addToChatLogprivate void addToChatLog(SignedMessage message, MessageType.Parameters params, com.mojang.authlib.GameProfile sender, MessageTrustStatus trustStatus) - Mappings:
- Namespace - Name - Mixin selector - named - addToChatLog- Lnet/minecraft/client/network/message/MessageHandler;addToChatLog(Lnet/minecraft/network/message/SignedMessage;Lnet/minecraft/network/message/MessageType$Parameters;Lcom/mojang/authlib/GameProfile;Lnet/minecraft/client/network/message/MessageTrustStatus;)V- intermediary - method_44737- Lnet/minecraft/class_7594;method_44737(Lnet/minecraft/class_7471;Lnet/minecraft/class_2556$class_7602;Lcom/mojang/authlib/GameProfile;Lnet/minecraft/class_7595;)V- official - a- Lgmi;a(Lxw;Lxc$a;Lcom/mojang/authlib/GameProfile;Lgmk;)V
 
- 
addToChatLog- Mappings:
- Namespace - Name - Mixin selector - named - addToChatLog- Lnet/minecraft/client/network/message/MessageHandler;addToChatLog(Lnet/minecraft/text/Text;Ljava/time/Instant;)V- intermediary - method_44735- Lnet/minecraft/class_7594;method_44735(Lnet/minecraft/class_2561;Ljava/time/Instant;)V- official - a- Lgmi;a(Lxg;Ljava/time/Instant;)V
 
- 
onGameMessageCalled when a game message is received.Game messages ignore chat delay. - Mappings:
- Namespace - Name - Mixin selector - named - onGameMessage- Lnet/minecraft/client/network/message/MessageHandler;onGameMessage(Lnet/minecraft/text/Text;Z)V- intermediary - method_44736- Lnet/minecraft/class_7594;method_44736(Lnet/minecraft/class_2561;Z)V- official - a- Lgmi;a(Lxg;Z)V
 
- 
extractSender- Mappings:
- Namespace - Name - Mixin selector - named - extractSender- Lnet/minecraft/client/network/message/MessageHandler;extractSender(Lnet/minecraft/text/Text;)Ljava/util/UUID;- intermediary - method_44734- Lnet/minecraft/class_7594;method_44734(Lnet/minecraft/class_2561;)Ljava/util/UUID;- official - a- Lgmi;a(Lxg;)Ljava/util/UUID;
 
- 
isAlwaysTrustedReturns whether messages fromsenderare always trusted.Messages from this client's player in a singleplayer world are always trusted. - Returns:
- whether messages from senderare always trusted
- Mappings:
- Namespace - Name - Mixin selector - named - isAlwaysTrusted- Lnet/minecraft/client/network/message/MessageHandler;isAlwaysTrusted(Ljava/util/UUID;)Z- intermediary - method_44738- Lnet/minecraft/class_7594;method_44738(Ljava/util/UUID;)Z- official - a- Lgmi;a(Ljava/util/UUID;)Z
 
 
-