Class MessageHandler
- Mappings:
Namespace Name official evcintermediary net/minecraft/class_7594named net/minecraft/client/network/message/MessageHandler
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprivate static interfaceA message to be processed. -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate longprivate final MinecraftClientprivate final Deque<MessageHandler.ProcessableMessage>private static final Textprivate long -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate voidaddToChatLog(MessageHeader header, MessageSignatureData signatures, byte[] bodyDigest) private voidaddToChatLog(SignedMessage message, MessageType.Parameters params, @Nullable PlayerListEntry senderEntry, MessageTrustStatus trustStatus) private voidaddToChatLog(Text message, Instant timestamp) private UUIDextractSender(Text text) private @Nullable PlayerListEntrygetPlayerListEntry(UUID sender) Returns the player list entry forsender, ornullif the sender's UUID did not correspond to any known players.private MessageTrustStatusgetStatus(SignedMessage message, Text decorated, @Nullable PlayerListEntry senderEntry, 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 voidprivate voidnarrate(MessageType.Parameters params, SignedMessage message) Narratesmessage.voidonChatMessage(SignedMessage message, MessageType.Parameters params) Called when a chat message is received.voidonGameMessage(Text message, boolean overlay) Called when a game message is received.voidonMessageHeader(MessageHeader header, MessageSignatureData signature, byte[] bodyDigest) Called when a message header is received.voidprocess()Processes one delayed message from the queue's beginning.private voidprocess(MessageHandler.ProcessableMessage message) Queuesprocessorduring the chat delay, otherwise runs the processor.voidProcesses all delayed messages from the queue.(package private) booleanprocessChatMessage(MessageType.Parameters params, SignedMessage message, Text decorated, @Nullable PlayerListEntry senderEntry, boolean onlyShowSecureChat, Instant receptionTimestamp) Processes a chat message and sends acknowledgment to the server.private booleanprocessChatMessageInternal(MessageType.Parameters params, SignedMessage message, Text decorated, @Nullable PlayerListEntry senderEntry, 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.(package private) booleanprocessHeader(MessageHeader messageHeader, MessageSignatureData messageSignatureData, byte[] bodyDigest) Processes a received message header.(package private) booleanprocessProfilelessMessage(MessageType.Parameters params, SignedMessage message, Text decorated) Processes a message that is sent as chat message but lacks the sender.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
-
field_39904
- Mappings:
Namespace Name Mixin selector official aLevc;a:Lrp;intermediary field_39904Lnet/minecraft/class_7594;field_39904:Lnet/minecraft/class_2561;named field_39904Lnet/minecraft/client/network/message/MessageHandler;field_39904:Lnet/minecraft/text/Text;
-
client
- Mappings:
Namespace Name Mixin selector official bLevc;b:Lefs;intermediary field_39779Lnet/minecraft/class_7594;field_39779:Lnet/minecraft/class_310;named clientLnet/minecraft/client/network/message/MessageHandler;client:Lnet/minecraft/client/MinecraftClient;
-
delayedMessages
- Mappings:
Namespace Name Mixin selector official cLevc;c:Ljava/util/Deque;intermediary field_39796Lnet/minecraft/class_7594;field_39796:Ljava/util/Deque;named delayedMessagesLnet/minecraft/client/network/message/MessageHandler;delayedMessages:Ljava/util/Deque;
-
chatDelay
private long chatDelay- Mappings:
Namespace Name Mixin selector official dLevc;d:Jintermediary field_39797Lnet/minecraft/class_7594;field_39797:Jnamed chatDelayLnet/minecraft/client/network/message/MessageHandler;chatDelay:J
-
lastProcessTime
private long lastProcessTime- Mappings:
Namespace Name Mixin selector official eLevc;e:Jintermediary field_39798Lnet/minecraft/class_7594;field_39798:Jnamed lastProcessTimeLnet/minecraft/client/network/message/MessageHandler;lastProcessTime:J
-
-
Constructor Details
-
MessageHandler
- Mappings:
Namespace Name Mixin selector official <init>Levc;<init>(Lefs;)Vintermediary <init>Lnet/minecraft/class_7594;<init>(Lnet/minecraft/class_310;)Vnamed <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 aLevc;a()Vintermediary method_44765Lnet/minecraft/class_7594;method_44765()Vnamed processDelayedMessagesLnet/minecraft/client/network/message/MessageHandler;processDelayedMessages()V
-
setChatDelay
public 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 official aLevc;a(D)Vintermediary method_44766Lnet/minecraft/class_7594;method_44766(D)Vnamed setChatDelayLnet/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 bLevc;b()Vintermediary method_44769Lnet/minecraft/class_7594;method_44769()Vnamed processLnet/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 cLevc;c()Jintermediary method_44944Lnet/minecraft/class_7594;method_44944()Jnamed getUnprocessedMessageCountLnet/minecraft/client/network/message/MessageHandler;getUnprocessedMessageCount()J
-
processAll
public void processAll()Processes all delayed messages from the queue.- Mappings:
Namespace Name Mixin selector official dLevc;d()Vintermediary method_44945Lnet/minecraft/class_7594;method_44945()Vnamed processAllLnet/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 aLevc;a(Lrx;)Zintermediary method_44819Lnet/minecraft/class_7594;method_44819(Lnet/minecraft/class_7469;)Znamed removeDelayedMessageLnet/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 eLevc;e()Zintermediary method_44775Lnet/minecraft/class_7594;method_44775()Znamed shouldDelayLnet/minecraft/client/network/message/MessageHandler;shouldDelay()Z
-
process
Queuesprocessorduring the chat delay, otherwise runs the processor.- Mappings:
Namespace Name Mixin selector official aLevc;a(Levc$a;)Vintermediary method_44818Lnet/minecraft/class_7594;method_44818(Lnet/minecraft/class_7594$class_7627;)Vnamed processLnet/minecraft/client/network/message/MessageHandler;process(Lnet/minecraft/client/network/message/MessageHandler$ProcessableMessage;)V
-
onChatMessage
Called when a chat message is received.This enqueues the message to be processed after the chat delay set in options, if any.
- See Also:
- Mappings:
Namespace Name Mixin selector official aLevc;a(Lsb;Lrl$a;)Vintermediary method_44733Lnet/minecraft/class_7594;method_44733(Lnet/minecraft/class_7471;Lnet/minecraft/class_2556$class_7602;)Vnamed onChatMessageLnet/minecraft/client/network/message/MessageHandler;onChatMessage(Lnet/minecraft/network/message/SignedMessage;Lnet/minecraft/network/message/MessageType$Parameters;)V
-
onMessageHeader
public void onMessageHeader(MessageHeader header, MessageSignatureData signature, byte[] bodyDigest) Called when a message header is received.Message header is received instead of the full message when a message is censored or when the message is originally sent without metadata due to it being originated from entities. This is to keep the integrity of the "message chain".
- Mappings:
Namespace Name Mixin selector official aLevc;a(Lsf;Lrx;[B)Vintermediary method_44820Lnet/minecraft/class_7594;method_44820(Lnet/minecraft/class_7614;Lnet/minecraft/class_7469;[B)Vnamed onMessageHeaderLnet/minecraft/client/network/message/MessageHandler;onMessageHeader(Lnet/minecraft/network/message/MessageHeader;Lnet/minecraft/network/message/MessageSignatureData;[B)V
-
processChatMessage
boolean processChatMessage(MessageType.Parameters params, SignedMessage message, Text decorated, @Nullable @Nullable PlayerListEntry senderEntry, boolean onlyShowSecureChat, Instant receptionTimestamp) Processes a chat message and sends acknowledgment to 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.- Parameters:
receptionTimestamp- the timestamp when the message was received by this client- Returns:
- whether the message was actually displayed
- See Also:
- Mappings:
Namespace Name Mixin selector official aLevc;a(Lrl$a;Lsb;Lrp;Leux;ZLjava/time/Instant;)Zintermediary method_44768Lnet/minecraft/class_7594;method_44768(Lnet/minecraft/class_2556$class_7602;Lnet/minecraft/class_7471;Lnet/minecraft/class_2561;Lnet/minecraft/class_640;ZLjava/time/Instant;)Znamed processChatMessageLnet/minecraft/client/network/message/MessageHandler;processChatMessage(Lnet/minecraft/network/message/MessageType$Parameters;Lnet/minecraft/network/message/SignedMessage;Lnet/minecraft/text/Text;Lnet/minecraft/client/network/PlayerListEntry;ZLjava/time/Instant;)Z
-
processChatMessageInternal
private boolean processChatMessageInternal(MessageType.Parameters params, SignedMessage message, Text decorated, @Nullable @Nullable PlayerListEntry senderEntry, boolean onlyShowSecureChat, Instant receptionTimestamp) Processes a chat message.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 official bLevc;b(Lrl$a;Lsb;Lrp;Leux;ZLjava/time/Instant;)Zintermediary method_44943Lnet/minecraft/class_7594;method_44943(Lnet/minecraft/class_2556$class_7602;Lnet/minecraft/class_7471;Lnet/minecraft/class_2561;Lnet/minecraft/class_640;ZLjava/time/Instant;)Znamed processChatMessageInternalLnet/minecraft/client/network/message/MessageHandler;processChatMessageInternal(Lnet/minecraft/network/message/MessageType$Parameters;Lnet/minecraft/network/message/SignedMessage;Lnet/minecraft/text/Text;Lnet/minecraft/client/network/PlayerListEntry;ZLjava/time/Instant;)Z
-
processProfilelessMessage
boolean processProfilelessMessage(MessageType.Parameters params, SignedMessage message, Text decorated) Processes a message that is sent as chat message but lacks the sender.This is usually a message sent via commands executed from
/executecommand.This adds the message to the hud, narrates it, and appends it to the chat log. The message is not verified.
- Mappings:
Namespace Name Mixin selector official aLevc;a(Lrl$a;Lsb;Lrp;)Zintermediary method_44767Lnet/minecraft/class_7594;method_44767(Lnet/minecraft/class_2556$class_7602;Lnet/minecraft/class_7471;Lnet/minecraft/class_2561;)Znamed processProfilelessMessageLnet/minecraft/client/network/message/MessageHandler;processProfilelessMessage(Lnet/minecraft/network/message/MessageType$Parameters;Lnet/minecraft/network/message/SignedMessage;Lnet/minecraft/text/Text;)Z
-
processHeader
boolean processHeader(MessageHeader messageHeader, MessageSignatureData messageSignatureData, byte[] bodyDigest) Processes a received message header.Message header is received instead of the full message when a message is censored or when the message is originally sent without metadata due to it being originated from entities. This is to keep the integrity of the "message chain".
This stores the header verification result and adds it to the chat log.
- See Also:
- Mappings:
Namespace Name Mixin selector official bLevc;b(Lsf;Lrx;[B)Zintermediary method_44821Lnet/minecraft/class_7594;method_44821(Lnet/minecraft/class_7614;Lnet/minecraft/class_7469;[B)Znamed processHeaderLnet/minecraft/client/network/message/MessageHandler;processHeader(Lnet/minecraft/network/message/MessageHeader;Lnet/minecraft/network/message/MessageSignatureData;[B)Z
-
method_45031
private void method_45031()- Mappings:
Namespace Name Mixin selector official fLevc;f()Vintermediary method_45031Lnet/minecraft/class_7594;method_45031()Vnamed method_45031Lnet/minecraft/client/network/message/MessageHandler;method_45031()V
-
narrate
Narratesmessage.- See Also:
- Mappings:
Namespace Name Mixin selector official aLevc;a(Lrl$a;Lsb;)Vintermediary method_44772Lnet/minecraft/class_7594;method_44772(Lnet/minecraft/class_2556$class_7602;Lnet/minecraft/class_7471;)Vnamed narrateLnet/minecraft/client/network/message/MessageHandler;narrate(Lnet/minecraft/network/message/MessageType$Parameters;Lnet/minecraft/network/message/SignedMessage;)V
-
getStatus
private MessageTrustStatus getStatus(SignedMessage message, Text decorated, @Nullable @Nullable PlayerListEntry senderEntry, 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 official aLevc;a(Lsb;Lrp;Leux;Ljava/time/Instant;)Levf;intermediary method_44732Lnet/minecraft/class_7594;method_44732(Lnet/minecraft/class_7471;Lnet/minecraft/class_2561;Lnet/minecraft/class_640;Ljava/time/Instant;)Lnet/minecraft/class_7595;named getStatusLnet/minecraft/client/network/message/MessageHandler;getStatus(Lnet/minecraft/network/message/SignedMessage;Lnet/minecraft/text/Text;Lnet/minecraft/client/network/PlayerListEntry;Ljava/time/Instant;)Lnet/minecraft/client/network/message/MessageTrustStatus;
-
addToChatLog
private void addToChatLog(SignedMessage message, MessageType.Parameters params, @Nullable @Nullable PlayerListEntry senderEntry, MessageTrustStatus trustStatus) - Mappings:
Namespace Name Mixin selector official aLevc;a(Lsb;Lrl$a;Leux;Levf;)Vintermediary method_44737Lnet/minecraft/class_7594;method_44737(Lnet/minecraft/class_7471;Lnet/minecraft/class_2556$class_7602;Lnet/minecraft/class_640;Lnet/minecraft/class_7595;)Vnamed addToChatLogLnet/minecraft/client/network/message/MessageHandler;addToChatLog(Lnet/minecraft/network/message/SignedMessage;Lnet/minecraft/network/message/MessageType$Parameters;Lnet/minecraft/client/network/PlayerListEntry;Lnet/minecraft/client/network/message/MessageTrustStatus;)V
-
addToChatLog
- Mappings:
Namespace Name Mixin selector official aLevc;a(Lrp;Ljava/time/Instant;)Vintermediary method_44735Lnet/minecraft/class_7594;method_44735(Lnet/minecraft/class_2561;Ljava/time/Instant;)Vnamed addToChatLogLnet/minecraft/client/network/message/MessageHandler;addToChatLog(Lnet/minecraft/text/Text;Ljava/time/Instant;)V
-
addToChatLog
- Mappings:
Namespace Name Mixin selector official cLevc;c(Lsf;Lrx;[B)Vintermediary method_44822Lnet/minecraft/class_7594;method_44822(Lnet/minecraft/class_7614;Lnet/minecraft/class_7469;[B)Vnamed addToChatLogLnet/minecraft/client/network/message/MessageHandler;addToChatLog(Lnet/minecraft/network/message/MessageHeader;Lnet/minecraft/network/message/MessageSignatureData;[B)V
-
getPlayerListEntry
Returns the player list entry forsender, ornullif the sender's UUID did not correspond to any known players.- Returns:
- the player list entry for
sender, ornullif the sender's UUID did not correspond to any known players - Mappings:
Namespace Name Mixin selector official aLevc;a(Ljava/util/UUID;)Leux;intermediary method_44731Lnet/minecraft/class_7594;method_44731(Ljava/util/UUID;)Lnet/minecraft/class_640;named getPlayerListEntryLnet/minecraft/client/network/message/MessageHandler;getPlayerListEntry(Ljava/util/UUID;)Lnet/minecraft/client/network/PlayerListEntry;
-
onGameMessage
Called when a game message is received.Game messages ignore chat delay.
- Mappings:
Namespace Name Mixin selector official aLevc;a(Lrp;Z)Vintermediary method_44736Lnet/minecraft/class_7594;method_44736(Lnet/minecraft/class_2561;Z)Vnamed onGameMessageLnet/minecraft/client/network/message/MessageHandler;onGameMessage(Lnet/minecraft/text/Text;Z)V
-
extractSender
- Mappings:
Namespace Name Mixin selector official aLevc;a(Lrp;)Ljava/util/UUID;intermediary method_44734Lnet/minecraft/class_7594;method_44734(Lnet/minecraft/class_2561;)Ljava/util/UUID;named extractSenderLnet/minecraft/client/network/message/MessageHandler;extractSender(Lnet/minecraft/text/Text;)Ljava/util/UUID;
-
isAlwaysTrusted
Returns 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 official bLevc;b(Ljava/util/UUID;)Zintermediary method_44738Lnet/minecraft/class_7594;method_44738(Ljava/util/UUID;)Znamed isAlwaysTrustedLnet/minecraft/client/network/message/MessageHandler;isAlwaysTrusted(Ljava/util/UUID;)Z
-