Record Class MessageType.Parameters

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

public static record MessageType.Parameters(RegistryEntry<MessageType> type, Text name, Optional<Text> targetName) extends Record
A record holding the message type and the decoration parameters.
Mappings:
Namespace Name
named net/minecraft/network/message/MessageType$Parameters
intermediary net/minecraft/class_2556$class_7602
official xl$a
named type
intermediary comp_919
official b
named name
intermediary comp_920
official c
named targetName
intermediary comp_921
official d
  • Field Details

    • type

      private final RegistryEntry<MessageType> type
      The field for the type record component.
    • name

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

      private final Optional<Text> targetName
      The field for the targetName record component.
    • CODEC

      Mappings:
      Namespace Name Mixin selector
      named CODEC Lnet/minecraft/network/message/MessageType$Parameters;CODEC:Lnet/minecraft/network/codec/PacketCodec;
      intermediary field_48776 Lnet/minecraft/class_2556$class_7602;field_48776:Lnet/minecraft/class_9139;
      official a Lxl$a;a:Lzn;
  • Constructor Details

    • Parameters

      Parameters(RegistryEntry<MessageType> type, Text name)
      Mappings:
      Namespace Name Mixin selector
      named <init> Lnet/minecraft/network/message/MessageType$Parameters;<init>(Lnet/minecraft/registry/entry/RegistryEntry;Lnet/minecraft/text/Text;)V
      intermediary <init> Lnet/minecraft/class_2556$class_7602;<init>(Lnet/minecraft/class_6880;Lnet/minecraft/class_2561;)V
      official <init> Lxl$a;<init>(Lji;Lxp;)V
    • Parameters

      public Parameters(RegistryEntry<MessageType> registryEntry, Text text, Optional<Text> optional)
  • Method Details

    • applyChatDecoration

      public Text applyChatDecoration(Text content)
      Mappings:
      Namespace Name Mixin selector
      named applyChatDecoration Lnet/minecraft/network/message/MessageType$Parameters;applyChatDecoration(Lnet/minecraft/text/Text;)Lnet/minecraft/text/Text;
      intermediary method_44837 Lnet/minecraft/class_2556$class_7602;method_44837(Lnet/minecraft/class_2561;)Lnet/minecraft/class_2561;
      official a Lxl$a;a(Lxp;)Lxp;
    • applyNarrationDecoration

      public Text applyNarrationDecoration(Text content)
      Mappings:
      Namespace Name Mixin selector
      named applyNarrationDecoration Lnet/minecraft/network/message/MessageType$Parameters;applyNarrationDecoration(Lnet/minecraft/text/Text;)Lnet/minecraft/text/Text;
      intermediary method_44838 Lnet/minecraft/class_2556$class_7602;method_44838(Lnet/minecraft/class_2561;)Lnet/minecraft/class_2561;
      official b Lxl$a;b(Lxp;)Lxp;
    • withTargetName

      public MessageType.Parameters withTargetName(Text targetName)
      Returns a new instance with the given target name.

      Target name is used as the team name in TeamMsgCommand and as the recipient name in MessageCommand.

      Returns:
      a new instance with the given target name
      Mappings:
      Namespace Name Mixin selector
      named withTargetName Lnet/minecraft/network/message/MessageType$Parameters;withTargetName(Lnet/minecraft/text/Text;)Lnet/minecraft/network/message/MessageType$Parameters;
      intermediary method_44839 Lnet/minecraft/class_2556$class_7602;method_44839(Lnet/minecraft/class_2561;)Lnet/minecraft/class_2556$class_7602;
      official c Lxl$a;c(Lxp;)Lxl$a;
    • 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. All components in this record class are compared with Objects::equals(Object,Object).
      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.
    • type

      public RegistryEntry<MessageType> type()
      Returns the value of the type record component.
      Returns:
      the value of the type record component
    • name

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

      public Optional<Text> targetName()
      Returns the value of the targetName record component.
      Returns:
      the value of the targetName record component