Class MessageChain

java.lang.Object
net.minecraft.network.message.MessageChain

public class MessageChain extends Object
A class for handling the "message chain".

MessageHeader includes the signature of the last message the client has seen. This can be used to verify the legitimacy of a chain of messages, since if the chain is valid, the last message's "previous signature" should be able to verify the preceding message.

Clients signing a message with its preceding message's signature is called "packing", and the server creating a signed message with its preceding message's signature is called "unpacking". Unpacked messages can then be verified to check the chain's legitimacy.

Mappings:
Namespace Name
official sg
intermediary net/minecraft/class_7610
named net/minecraft/network/message/MessageChain
  • Field Details

    • precedingSignature

      @Nullable private @Nullable MessageSignatureData precedingSignature
      Mappings:
      Namespace Name Mixin selector
      official a Lsg;a:Lrz;
      intermediary field_39818 Lnet/minecraft/class_7610;field_39818:Lnet/minecraft/class_7469;
      named precedingSignature Lnet/minecraft/network/message/MessageChain;precedingSignature:Lnet/minecraft/network/message/MessageSignatureData;
  • Constructor Details

    • MessageChain

      public MessageChain()
  • Method Details

    • pack

      private MessageChain.Signature pack(Signer signer, MessageMetadata metadata, DecoratedContents contents, LastSeenMessageList lastSeenMessages)
      Mappings:
      Namespace Name Mixin selector
      official a Lsg;a(Lamq;Lsa;Lri;Lrw;)Lsg$c;
      intermediary method_44875 Lnet/minecraft/class_7610;method_44875(Lnet/minecraft/class_7501;Lnet/minecraft/class_7470;Lnet/minecraft/class_7634;Lnet/minecraft/class_7635;)Lnet/minecraft/class_7610$class_7613;
      named pack Lnet/minecraft/network/message/MessageChain;pack(Lnet/minecraft/network/encryption/Signer;Lnet/minecraft/network/message/MessageMetadata;Lnet/minecraft/network/message/DecoratedContents;Lnet/minecraft/network/message/LastSeenMessageList;)Lnet/minecraft/network/message/MessageChain$Signature;
    • sign

      private static MessageSignatureData sign(Signer signer, MessageMetadata metadata, @Nullable @Nullable MessageSignatureData precedingSignature, DecoratedContents contents, LastSeenMessageList lastSeenMessages)
      Mappings:
      Namespace Name Mixin selector
      official a Lsg;a(Lamq;Lsa;Lrz;Lri;Lrw;)Lrz;
      intermediary method_44876 Lnet/minecraft/class_7610;method_44876(Lnet/minecraft/class_7501;Lnet/minecraft/class_7470;Lnet/minecraft/class_7469;Lnet/minecraft/class_7634;Lnet/minecraft/class_7635;)Lnet/minecraft/class_7469;
      named sign Lnet/minecraft/network/message/MessageChain;sign(Lnet/minecraft/network/encryption/Signer;Lnet/minecraft/network/message/MessageMetadata;Lnet/minecraft/network/message/MessageSignatureData;Lnet/minecraft/network/message/DecoratedContents;Lnet/minecraft/network/message/LastSeenMessageList;)Lnet/minecraft/network/message/MessageSignatureData;
    • unpack

      private SignedMessage unpack(MessageChain.Signature signature, MessageMetadata metadata, DecoratedContents contents, LastSeenMessageList lastSeenMessages)
      Mappings:
      Namespace Name Mixin selector
      official a Lsg;a(Lsg$c;Lsa;Lri;Lrw;)Lsd;
      intermediary method_44878 Lnet/minecraft/class_7610;method_44878(Lnet/minecraft/class_7610$class_7613;Lnet/minecraft/class_7470;Lnet/minecraft/class_7634;Lnet/minecraft/class_7635;)Lnet/minecraft/class_7471;
      named unpack Lnet/minecraft/network/message/MessageChain;unpack(Lnet/minecraft/network/message/MessageChain$Signature;Lnet/minecraft/network/message/MessageMetadata;Lnet/minecraft/network/message/DecoratedContents;Lnet/minecraft/network/message/LastSeenMessageList;)Lnet/minecraft/network/message/SignedMessage;
    • createMessage

      private static SignedMessage createMessage(MessageChain.Signature signature, @Nullable @Nullable MessageSignatureData precedingSignature, MessageMetadata metadata, DecoratedContents contents, LastSeenMessageList lastSeenMessage)
      Mappings:
      Namespace Name Mixin selector
      official a Lsg;a(Lsg$c;Lrz;Lsa;Lri;Lrw;)Lsd;
      intermediary method_44877 Lnet/minecraft/class_7610;method_44877(Lnet/minecraft/class_7610$class_7613;Lnet/minecraft/class_7469;Lnet/minecraft/class_7470;Lnet/minecraft/class_7634;Lnet/minecraft/class_7635;)Lnet/minecraft/class_7471;
      named createMessage Lnet/minecraft/network/message/MessageChain;createMessage(Lnet/minecraft/network/message/MessageChain$Signature;Lnet/minecraft/network/message/MessageSignatureData;Lnet/minecraft/network/message/MessageMetadata;Lnet/minecraft/network/message/DecoratedContents;Lnet/minecraft/network/message/LastSeenMessageList;)Lnet/minecraft/network/message/SignedMessage;
    • getUnpacker

      public MessageChain.Unpacker getUnpacker()
      Mappings:
      Namespace Name Mixin selector
      official a Lsg;a()Lsg$a;
      intermediary method_44874 Lnet/minecraft/class_7610;method_44874()Lnet/minecraft/class_7610$class_7611;
      named getUnpacker Lnet/minecraft/network/message/MessageChain;getUnpacker()Lnet/minecraft/network/message/MessageChain$Unpacker;
    • getPacker

      public MessageChain.Packer getPacker()
      Mappings:
      Namespace Name Mixin selector
      official b Lsg;b()Lsg$b;
      intermediary method_44880 Lnet/minecraft/class_7610;method_44880()Lnet/minecraft/class_7610$class_7612;
      named getPacker Lnet/minecraft/network/message/MessageChain;getPacker()Lnet/minecraft/network/message/MessageChain$Packer;