Package net.minecraft.network
Record Class MessageFormat
java.lang.Object
java.lang.Record
net.minecraft.network.MessageFormat
- Record Components:
translationKey-parameters-style-
public record MessageFormat(String translationKey, List<MessageFormat.Parameter> parameters, Style style)
extends Record
A message format applies on a server-sent message and its sender to
stylize it.
- Mappings:
Namespace Name official raintermediary net/minecraft/class_7463named net/minecraft/network/MessageFormatofficial bintermediary comp_788named translationKeyofficial cintermediary comp_789named parametersofficial dintermediary comp_790named style
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumA parameter for the translation text of a message format. -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final com.mojang.serialization.Codec<MessageFormat>The codec for chat format.private final List<MessageFormat.Parameter>The field for theparametersrecord component.private final StyleThe field for thestylerecord component.private final StringThe field for thetranslationKeyrecord component. -
Constructor Summary
ConstructorsConstructorDescriptionMessageFormat(String string, List<MessageFormat.Parameter> list, Style style) -
Method Summary
Modifier and TypeMethodDescriptionapply(Text content, @Nullable ChatMessageSender sender) final booleanIndicates whether some other object is "equal to" this one.private Text[]getArgs(Text content, @Nullable ChatMessageSender sender) final inthashCode()Returns a hash code value for this object.static MessageFormatitalicGray(String translationKey) Returns a message format that applies the translation key with the sender's name and the message content, and applies a gray, italic style.Returns the value of theparametersrecord component.static MessageFormatReturns a message format that applies the translation key with the sender's name and the message content.style()Returns the value of thestylerecord component.static MessageFormatReturns a message format that applies the translation key with the sender's team name, the sender's name, and the message content.final StringtoString()Returns a string representation of this record class.Returns the value of thetranslationKeyrecord component.
-
Field Details
-
translationKey
The field for thetranslationKeyrecord component. -
parameters
The field for theparametersrecord component. -
style
The field for thestylerecord component. -
CODEC
The codec for chat format.- Mappings:
Namespace Name Mixin selector official aLra;a:Lcom/mojang/serialization/Codec;intermediary field_39219Lnet/minecraft/class_7463;field_39219:Lcom/mojang/serialization/Codec;named CODECLnet/minecraft/network/MessageFormat;CODEC:Lcom/mojang/serialization/Codec;
-
-
Constructor Details
-
MessageFormat
-
-
Method Details
-
plain
Returns a message format that applies the translation key with the sender's name and the message content.- Returns:
- a message format that applies the translation key with the sender's name and the message content
- Mappings:
Namespace Name Mixin selector official aLra;a(Ljava/lang/String;)Lra;intermediary method_43831Lnet/minecraft/class_7463;method_43831(Ljava/lang/String;)Lnet/minecraft/class_7463;named plainLnet/minecraft/network/MessageFormat;plain(Ljava/lang/String;)Lnet/minecraft/network/MessageFormat;
-
italicGray
Returns a message format that applies the translation key with the sender's name and the message content, and applies a gray, italic style.- Returns:
- a message format that applies the translation key with the sender's name and the message content, and applies a gray, italic style
- Mappings:
Namespace Name Mixin selector official bLra;b(Ljava/lang/String;)Lra;intermediary method_43833Lnet/minecraft/class_7463;method_43833(Ljava/lang/String;)Lnet/minecraft/class_7463;named italicGrayLnet/minecraft/network/MessageFormat;italicGray(Ljava/lang/String;)Lnet/minecraft/network/MessageFormat;
-
team
Returns a message format that applies the translation key with the sender's team name, the sender's name, and the message content.- Returns:
- a message format that applies the translation key with the sender's team name, the sender's name, and the message content
- Mappings:
Namespace Name Mixin selector official cLra;c(Ljava/lang/String;)Lra;intermediary method_43835Lnet/minecraft/class_7463;method_43835(Ljava/lang/String;)Lnet/minecraft/class_7463;named teamLnet/minecraft/network/MessageFormat;team(Ljava/lang/String;)Lnet/minecraft/network/MessageFormat;
-
apply
- Mappings:
Namespace Name Mixin selector official aLra;a(Lrf;Lrb;)Lrf;intermediary method_43832Lnet/minecraft/class_7463;method_43832(Lnet/minecraft/class_2561;Lnet/minecraft/class_7436;)Lnet/minecraft/class_2561;named applyLnet/minecraft/network/MessageFormat;apply(Lnet/minecraft/text/Text;Lnet/minecraft/network/ChatMessageSender;)Lnet/minecraft/text/Text;
-
getArgs
- Mappings:
Namespace Name Mixin selector official bLra;b(Lrf;Lrb;)[Lrf;intermediary method_43834Lnet/minecraft/class_7463;method_43834(Lnet/minecraft/class_2561;Lnet/minecraft/class_7436;)[Lnet/minecraft/class_2561;named getArgsLnet/minecraft/network/MessageFormat;getArgs(Lnet/minecraft/text/Text;Lnet/minecraft/network/ChatMessageSender;)[Lnet/minecraft/text/Text;
-
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. -
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. -
equals
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 withObjects::equals(Object,Object). -
translationKey
Returns the value of thetranslationKeyrecord component.- Returns:
- the value of the
translationKeyrecord component
-
parameters
Returns the value of theparametersrecord component.- Returns:
- the value of the
parametersrecord component
-
style
Returns the value of thestylerecord component.- Returns:
- the value of the
stylerecord component
-