Package net.minecraft.network
Record Class MessageType.NarrationRule
java.lang.Object
java.lang.Record
net.minecraft.network.MessageType.NarrationRule
- Record Components:
decoration
- the formatting of a message, orOptional.empty()
if the content is displayed directlypriority
- the narration kind, and if this narration can interrupt other ones
- Enclosing class:
MessageType
public static record MessageType.NarrationRule(Optional<MessageFormat> decoration, MessageType.NarrationRule.Kind priority)
extends Record
A narration rule for a message.
- Mappings:
Namespace Name official rc$a
intermediary net/minecraft/class_2556$class_7466
named net/minecraft/network/MessageType$NarrationRule
official b
intermediary comp_795
named decoration
official c
intermediary comp_796
named priority
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final com.mojang.serialization.Codec<MessageType.NarrationRule>
The codec for the message narraton rule.private final Optional<MessageFormat>
The field for thedecoration
record component.private final MessageType.NarrationRule.Kind
The field for thepriority
record component. -
Constructor Summary
ConstructorsConstructorDescriptionNarrationRule
(Optional<MessageFormat> optional, MessageType.NarrationRule.Kind kind) -
Method Summary
Modifier and TypeMethodDescriptionapply
(Text content, @Nullable ChatMessageSender sender) Returns the text to narrate after applying this rule on the given content and sender.Returns the value of thedecoration
record component.final boolean
Indicates whether some other object is "equal to" this one.final int
hashCode()
Returns a hash code value for this object.static MessageType.NarrationRule
of
(MessageFormat decoration, MessageType.NarrationRule.Kind kind) Returns a rule that narrates a message after formatting.static MessageType.NarrationRule
Returns a rule that narrates a message's content directly.priority()
Returns the value of thepriority
record component.final String
toString()
Returns a string representation of this record class.
-
Field Details
-
decoration
The field for thedecoration
record component. -
priority
The field for thepriority
record component. -
CODEC
The codec for the message narraton rule.- Mappings:
Namespace Name Mixin selector official a
Lrc$a;a:Lcom/mojang/serialization/Codec;
intermediary field_39233
Lnet/minecraft/class_2556$class_7466;field_39233:Lcom/mojang/serialization/Codec;
named CODEC
Lnet/minecraft/network/MessageType$NarrationRule;CODEC:Lcom/mojang/serialization/Codec;
-
-
Constructor Details
-
NarrationRule
-
-
Method Details
-
of
Returns a rule that narrates a message's content directly. The message is narrated as the givenkind
, without any sender-related information.- Returns:
- a rule that narrates a message's content directly
- Mappings:
Namespace Name Mixin selector official a
Lrc$a;a(Lrc$a$a;)Lrc$a;
intermediary method_43848
Lnet/minecraft/class_2556$class_7466;method_43848(Lnet/minecraft/class_2556$class_7466$class_7467;)Lnet/minecraft/class_2556$class_7466;
named of
Lnet/minecraft/network/MessageType$NarrationRule;of(Lnet/minecraft/network/MessageType$NarrationRule$Kind;)Lnet/minecraft/network/MessageType$NarrationRule;
-
of
public static MessageType.NarrationRule of(MessageFormat decoration, MessageType.NarrationRule.Kind kind) Returns a rule that narrates a message after formatting. The message is narrated as the givenkind
, and the narration can include sender information in addition to the message content.- Returns:
- a rule that narrates a message after formatting
- Mappings:
Namespace Name Mixin selector official a
Lrc$a;a(Lra;Lrc$a$a;)Lrc$a;
intermediary method_43847
Lnet/minecraft/class_2556$class_7466;method_43847(Lnet/minecraft/class_7463;Lnet/minecraft/class_2556$class_7466$class_7467;)Lnet/minecraft/class_2556$class_7466;
named of
Lnet/minecraft/network/MessageType$NarrationRule;of(Lnet/minecraft/network/MessageFormat;Lnet/minecraft/network/MessageType$NarrationRule$Kind;)Lnet/minecraft/network/MessageType$NarrationRule;
-
apply
Returns the text to narrate after applying this rule on the given content and sender.- Returns:
- the text to narrate after applying this rule on the given content and sender
- Mappings:
Namespace Name Mixin selector official a
Lrc$a;a(Lrf;Lrb;)Lrf;
intermediary method_43849
Lnet/minecraft/class_2556$class_7466;method_43849(Lnet/minecraft/class_2561;Lnet/minecraft/class_7436;)Lnet/minecraft/class_2561;
named apply
Lnet/minecraft/network/MessageType$NarrationRule;apply(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)
. -
decoration
Returns the value of thedecoration
record component.- Returns:
- the value of the
decoration
record component
-
priority
Returns the value of thepriority
record component.- Returns:
- the value of the
priority
record component
-