Class MessageHandler
java.lang.Object
net.minecraft.client.network.message.MessageHandler
Handles received messages, including chat messages and game messages.
- Mappings:
Namespace Name official ffg
intermediary net/minecraft/class_7594
named net/minecraft/client/network/message/MessageHandler
-
Nested Class Summary
Modifier and TypeClassDescriptionprivate static final record
A message to be processed. -
Field Summary
Modifier and TypeFieldDescriptionprivate long
private final MinecraftClient
private final Deque<MessageHandler.ProcessableMessage>
private long
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprivate void
addToChatLog
(SignedMessage message, MessageType.Parameters params, com.mojang.authlib.GameProfile sender, MessageTrustStatus trustStatus) private void
addToChatLog
(Text message, Instant timestamp) private UUID
extractSender
(Text text) private MessageTrustStatus
getStatus
(SignedMessage message, Text decorated, Instant receptionTimestamp) Returns the trust status ofmessage
.long
Returns the number of delayed messages that are not processed yet.private boolean
isAlwaysTrusted
(UUID sender) Returns whether messages fromsender
are always trusted.private void
narrate
(MessageType.Parameters params, Text message) Narratesmessage
.void
onChatMessage
(SignedMessage message, com.mojang.authlib.GameProfile sender, MessageType.Parameters params) void
onGameMessage
(Text message, boolean overlay) Called when a game message is received.void
onProfilelessMessage
(Text content, MessageType.Parameters params) void
process()
Processes one delayed message from the queue's beginning.private void
process
(@Nullable MessageSignatureData signature, BooleanSupplier processor) Queuesprocessor
during the chat delay, otherwise runs the processor.void
Processes all delayed messages from the queue.private boolean
processChatMessageInternal
(MessageType.Parameters params, SignedMessage message, Text decorated, com.mojang.authlib.GameProfile sender, boolean onlyShowSecureChat, Instant receptionTimestamp) Processes a chat message.void
Processes all delayed messages until one of them fails to process if the delay has passed, and otherwise does nothing.boolean
removeDelayedMessage
(MessageSignatureData signature) Removes a delayed message whose signature matchessignature
.void
setChatDelay
(double chatDelay) Sets the chat delay tochatDelay
seconds.private boolean
Returns if the chat delay is set and the message should be delayed.
-
Field Details
-
client
- Mappings:
Namespace Name Mixin selector official a
Lffg;a:Lenn;
intermediary field_39779
Lnet/minecraft/class_7594;field_39779:Lnet/minecraft/class_310;
named client
Lnet/minecraft/client/network/message/MessageHandler;client:Lnet/minecraft/client/MinecraftClient;
-
delayedMessages
- Mappings:
Namespace Name Mixin selector official b
Lffg;b:Ljava/util/Deque;
intermediary field_39796
Lnet/minecraft/class_7594;field_39796:Ljava/util/Deque;
named delayedMessages
Lnet/minecraft/client/network/message/MessageHandler;delayedMessages:Ljava/util/Deque;
-
chatDelay
private long chatDelay- Mappings:
Namespace Name Mixin selector official c
Lffg;c:J
intermediary field_39797
Lnet/minecraft/class_7594;field_39797:J
named chatDelay
Lnet/minecraft/client/network/message/MessageHandler;chatDelay:J
-
lastProcessTime
private long lastProcessTime- Mappings:
Namespace Name Mixin selector official d
Lffg;d:J
intermediary field_39798
Lnet/minecraft/class_7594;field_39798:J
named lastProcessTime
Lnet/minecraft/client/network/message/MessageHandler;lastProcessTime:J
-
-
Constructor Details
-
MessageHandler
- Mappings:
Namespace Name Mixin selector official <init>
Lffg;<init>(Lenn;)V
intermediary <init>
Lnet/minecraft/class_7594;<init>(Lnet/minecraft/class_310;)V
named <init>
Lnet/minecraft/client/network/message/MessageHandler;<init>(Lnet/minecraft/client/MinecraftClient;)V
-
-
Method Details
-
processDelayedMessages
public 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 official a
Lffg;a()V
intermediary method_44765
Lnet/minecraft/class_7594;method_44765()V
named processDelayedMessages
Lnet/minecraft/client/network/message/MessageHandler;processDelayedMessages()V
-
setChatDelay
public void setChatDelay(double chatDelay) Sets the chat delay tochatDelay
seconds. If the chat delay was changed to0
, this also processes all queued messages.- Mappings:
Namespace Name Mixin selector official a
Lffg;a(D)V
intermediary method_44766
Lnet/minecraft/class_7594;method_44766(D)V
named setChatDelay
Lnet/minecraft/client/network/message/MessageHandler;setChatDelay(D)V
-
process
public void process()Processes one delayed message from the queue's beginning.- Mappings:
Namespace Name Mixin selector official b
Lffg;b()V
intermediary method_44769
Lnet/minecraft/class_7594;method_44769()V
named process
Lnet/minecraft/client/network/message/MessageHandler;process()V
-
getUnprocessedMessageCount
public 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 official c
Lffg;c()J
intermediary method_44944
Lnet/minecraft/class_7594;method_44944()J
named getUnprocessedMessageCount
Lnet/minecraft/client/network/message/MessageHandler;getUnprocessedMessageCount()J
-
processAll
public void processAll()Processes all delayed messages from the queue.- Mappings:
Namespace Name Mixin selector official d
Lffg;d()V
intermediary method_44945
Lnet/minecraft/class_7594;method_44945()V
named processAll
Lnet/minecraft/client/network/message/MessageHandler;processAll()V
-
removeDelayedMessage
Removes 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 official a
Lffg;a(Lth;)Z
intermediary method_44819
Lnet/minecraft/class_7594;method_44819(Lnet/minecraft/class_7469;)Z
named removeDelayedMessage
Lnet/minecraft/client/network/message/MessageHandler;removeDelayedMessage(Lnet/minecraft/network/message/MessageSignatureData;)Z
-
shouldDelay
private 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 official e
Lffg;e()Z
intermediary method_44775
Lnet/minecraft/class_7594;method_44775()Z
named shouldDelay
Lnet/minecraft/client/network/message/MessageHandler;shouldDelay()Z
-
process
Queuesprocessor
during the chat delay, otherwise runs the processor.- Mappings:
Namespace Name Mixin selector official a
Lffg;a(Lth;Ljava/util/function/BooleanSupplier;)V
intermediary method_44818
Lnet/minecraft/class_7594;method_44818(Lnet/minecraft/class_7469;Ljava/util/function/BooleanSupplier;)V
named process
Lnet/minecraft/client/network/message/MessageHandler;process(Lnet/minecraft/network/message/MessageSignatureData;Ljava/util/function/BooleanSupplier;)V
-
onChatMessage
public void onChatMessage(SignedMessage message, com.mojang.authlib.GameProfile sender, MessageType.Parameters params) - Mappings:
Namespace Name Mixin selector official a
Lffg;a(Ltl;Lcom/mojang/authlib/GameProfile;Lss$a;)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
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
-
onProfilelessMessage
- Mappings:
Namespace Name Mixin selector official a
Lffg;a(Lsw;Lss$a;)V
intermediary method_45746
Lnet/minecraft/class_7594;method_45746(Lnet/minecraft/class_2561;Lnet/minecraft/class_2556$class_7602;)V
named onProfilelessMessage
Lnet/minecraft/client/network/message/MessageHandler;onProfilelessMessage(Lnet/minecraft/text/Text;Lnet/minecraft/network/message/MessageType$Parameters;)V
-
processChatMessageInternal
private 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
onlyShowSecureChat
istrue
or 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 official a
Lffg;a(Lss$a;Ltl;Lsw;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
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
-
narrate
Narratesmessage
.- See Also:
- Mappings:
Namespace Name Mixin selector official a
Lffg;a(Lss$a;Lsw;)V
intermediary method_44772
Lnet/minecraft/class_7594;method_44772(Lnet/minecraft/class_2556$class_7602;Lnet/minecraft/class_2561;)V
named narrate
Lnet/minecraft/client/network/message/MessageHandler;narrate(Lnet/minecraft/network/message/MessageType$Parameters;Lnet/minecraft/text/Text;)V
-
getStatus
private MessageTrustStatus getStatus(SignedMessage message, Text decorated, Instant receptionTimestamp) Returns the trust status ofmessage
.This returns
MessageTrustStatus.SECURE
for messages that are considered to be always trusted.- Returns:
- the trust status of
message
- See Also:
- Mappings:
Namespace Name Mixin selector official a
Lffg;a(Ltl;Lsw;Ljava/time/Instant;)Lffi;
intermediary method_44732
Lnet/minecraft/class_7594;method_44732(Lnet/minecraft/class_7471;Lnet/minecraft/class_2561;Ljava/time/Instant;)Lnet/minecraft/class_7595;
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;
-
addToChatLog
private void addToChatLog(SignedMessage message, MessageType.Parameters params, com.mojang.authlib.GameProfile sender, MessageTrustStatus trustStatus) - Mappings:
Namespace Name Mixin selector official a
Lffg;a(Ltl;Lss$a;Lcom/mojang/authlib/GameProfile;Lffi;)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
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
-
addToChatLog
- Mappings:
Namespace Name Mixin selector official a
Lffg;a(Lsw;Ljava/time/Instant;)V
intermediary method_44735
Lnet/minecraft/class_7594;method_44735(Lnet/minecraft/class_2561;Ljava/time/Instant;)V
named addToChatLog
Lnet/minecraft/client/network/message/MessageHandler;addToChatLog(Lnet/minecraft/text/Text;Ljava/time/Instant;)V
-
onGameMessage
Called when a game message is received.Game messages ignore chat delay.
- Mappings:
Namespace Name Mixin selector official a
Lffg;a(Lsw;Z)V
intermediary method_44736
Lnet/minecraft/class_7594;method_44736(Lnet/minecraft/class_2561;Z)V
named onGameMessage
Lnet/minecraft/client/network/message/MessageHandler;onGameMessage(Lnet/minecraft/text/Text;Z)V
-
extractSender
- Mappings:
Namespace Name Mixin selector official a
Lffg;a(Lsw;)Ljava/util/UUID;
intermediary method_44734
Lnet/minecraft/class_7594;method_44734(Lnet/minecraft/class_2561;)Ljava/util/UUID;
named extractSender
Lnet/minecraft/client/network/message/MessageHandler;extractSender(Lnet/minecraft/text/Text;)Ljava/util/UUID;
-
isAlwaysTrusted
Returns whether messages fromsender
are always trusted.Messages from this client's player in a singleplayer world are always trusted.
- Returns:
- whether messages from
sender
are always trusted - Mappings:
Namespace Name Mixin selector official a
Lffg;a(Ljava/util/UUID;)Z
intermediary method_44738
Lnet/minecraft/class_7594;method_44738(Ljava/util/UUID;)Z
named isAlwaysTrusted
Lnet/minecraft/client/network/message/MessageHandler;isAlwaysTrusted(Ljava/util/UUID;)Z
-