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 ra
intermediary net/minecraft/class_7463
named net/minecraft/network/MessageFormat
official b
intermediary comp_788
named translationKey
official c
intermediary comp_789
named parameters
official d
intermediary comp_790
named style
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enum
A 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 theparameters
record component.private final Style
The field for thestyle
record component.private final String
The field for thetranslationKey
record component. -
Constructor Summary
ConstructorsConstructorDescriptionMessageFormat
(String string, List<MessageFormat.Parameter> list, Style style) -
Method Summary
Modifier and TypeMethodDescriptionapply
(Text content, @Nullable ChatMessageSender sender) final boolean
Indicates whether some other object is "equal to" this one.private Text[]
getArgs
(Text content, @Nullable ChatMessageSender sender) final int
hashCode()
Returns a hash code value for this object.static MessageFormat
italicGray
(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 theparameters
record component.static MessageFormat
Returns a message format that applies the translation key with the sender's name and the message content.style()
Returns the value of thestyle
record component.static MessageFormat
Returns a message format that applies the translation key with the sender's team name, the sender's name, and the message content.final String
toString()
Returns a string representation of this record class.Returns the value of thetranslationKey
record component.
-
Field Details
-
translationKey
The field for thetranslationKey
record component. -
parameters
The field for theparameters
record component. -
style
The field for thestyle
record component. -
CODEC
The codec for chat format.- Mappings:
Namespace Name Mixin selector official a
Lra;a:Lcom/mojang/serialization/Codec;
intermediary field_39219
Lnet/minecraft/class_7463;field_39219:Lcom/mojang/serialization/Codec;
named CODEC
Lnet/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 a
Lra;a(Ljava/lang/String;)Lra;
intermediary method_43831
Lnet/minecraft/class_7463;method_43831(Ljava/lang/String;)Lnet/minecraft/class_7463;
named plain
Lnet/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 b
Lra;b(Ljava/lang/String;)Lra;
intermediary method_43833
Lnet/minecraft/class_7463;method_43833(Ljava/lang/String;)Lnet/minecraft/class_7463;
named italicGray
Lnet/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 c
Lra;c(Ljava/lang/String;)Lra;
intermediary method_43835
Lnet/minecraft/class_7463;method_43835(Ljava/lang/String;)Lnet/minecraft/class_7463;
named team
Lnet/minecraft/network/MessageFormat;team(Ljava/lang/String;)Lnet/minecraft/network/MessageFormat;
-
apply
- Mappings:
Namespace Name Mixin selector official a
Lra;a(Lrf;Lrb;)Lrf;
intermediary method_43832
Lnet/minecraft/class_7463;method_43832(Lnet/minecraft/class_2561;Lnet/minecraft/class_7436;)Lnet/minecraft/class_2561;
named apply
Lnet/minecraft/network/MessageFormat;apply(Lnet/minecraft/text/Text;Lnet/minecraft/network/ChatMessageSender;)Lnet/minecraft/text/Text;
-
getArgs
- Mappings:
Namespace Name Mixin selector official b
Lra;b(Lrf;Lrb;)[Lrf;
intermediary method_43834
Lnet/minecraft/class_7463;method_43834(Lnet/minecraft/class_2561;Lnet/minecraft/class_7436;)[Lnet/minecraft/class_2561;
named getArgs
Lnet/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 thetranslationKey
record component.- Returns:
- the value of the
translationKey
record component
-
parameters
Returns the value of theparameters
record component.- Returns:
- the value of the
parameters
record component
-
style
Returns the value of thestyle
record component.- Returns:
- the value of the
style
record component
-