Record Class MessageType.Serialized

java.lang.Object
java.lang.Record
net.minecraft.network.message.MessageType.Serialized
Record Components:
typeId -
name -
targetName -
Enclosing class:
MessageType

public static record MessageType.Serialized(int typeId, Text name, @Nullable Text targetName) extends Record
The serialized version of MessageType.Parameters that is used in packets.
Mappings:
Namespace Name
official vb$b
intermediary net/minecraft/class_2556$class_7603
named net/minecraft/network/message/MessageType$Serialized
official a
intermediary comp_922
named typeId
official b
intermediary comp_923
named name
official c
intermediary comp_924
named targetName
  • Field Details

    • typeId

      private final int typeId
      The field for the typeId record component.
    • name

      private final Text name
      The field for the name record component.
    • targetName

      @Nullable private final @Nullable Text targetName
      The field for the targetName record component.
  • Constructor Details

    • Serialized

      public Serialized(PacketByteBuf buf)
      Mappings:
      Namespace Name Mixin selector
      official <init> Lvb$b;<init>(Lui;)V
      intermediary <init> Lnet/minecraft/class_2556$class_7603;<init>(Lnet/minecraft/class_2540;)V
      named <init> Lnet/minecraft/network/message/MessageType$Serialized;<init>(Lnet/minecraft/network/PacketByteBuf;)V
    • Serialized

      public Serialized(int int2, Text text, @Nullable @Nullable Text text2)
  • Method Details

    • write

      public void write(PacketByteBuf buf)
      Mappings:
      Namespace Name Mixin selector
      official a Lvb$b;a(Lui;)V
      intermediary method_44841 Lnet/minecraft/class_2556$class_7603;method_44841(Lnet/minecraft/class_2540;)V
      named write Lnet/minecraft/network/message/MessageType$Serialized;write(Lnet/minecraft/network/PacketByteBuf;)V
    • toParameters

      public Optional<MessageType.Parameters> toParameters(DynamicRegistryManager registryManager)
      Returns a deserialized version of this instance, or Optional.empty() if typeId is unknown to the client.
      Returns:
      a deserialized version of this instance, or Optional.empty() if typeId is unknown to the client
      Mappings:
      Namespace Name Mixin selector
      official a Lvb$b;a(Liu;)Ljava/util/Optional;
      intermediary method_44840 Lnet/minecraft/class_2556$class_7603;method_44840(Lnet/minecraft/class_5455;)Ljava/util/Optional;
      named toParameters Lnet/minecraft/network/message/MessageType$Serialized;toParameters(Lnet/minecraft/registry/DynamicRegistryManager;)Ljava/util/Optional;
    • toString

      public final String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • hashCode

      public final int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object object)
      Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. Reference components are compared with Objects::equals(Object,Object); primitive components are compared with '=='.
      Specified by:
      equals in class Record
      Parameters:
      object - the object with which to compare
      Returns:
      true if this object is the same as the object argument; false otherwise.
    • typeId

      public int typeId()
      Returns the value of the typeId record component.
      Returns:
      the value of the typeId record component
    • name

      public Text name()
      Returns the value of the name record component.
      Returns:
      the value of the name record component
    • targetName

      @Nullable public @Nullable Text targetName()
      Returns the value of the targetName record component.
      Returns:
      the value of the targetName record component