Package net.minecraft.network
Record Class MessageType.NarrationRule
java.lang.Object
java.lang.Record
net.minecraft.network.MessageType.NarrationRule
- Record Components:
decoration
- the decoration applied to a message, orOptional.empty()
if the content is narrated as iskind
- the kind of the narration, also known aspriority
in the serialized format
- Enclosing class:
MessageType
public static record MessageType.NarrationRule(Optional<Decoration> decoration, MessageType.NarrationRule.Kind kind)
extends Record
The narration rule for the message type. This contains the decoration applied
to the message and the kind of the narration (
priority
when serialized).- Mappings:
Namespace Name official rj$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 kind
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic enum
The kind of narration. -
Field Summary
Modifier and TypeFieldDescriptionstatic final com.mojang.serialization.Codec<MessageType.NarrationRule>
private final Optional<Decoration>
The field for thedecoration
record component.private final MessageType.NarrationRule.Kind
The field for thekind
record component. -
Constructor Summary
ConstructorDescriptionNarrationRule
(Optional<Decoration> optional, MessageType.NarrationRule.Kind kind) -
Method Summary
Modifier and TypeMethodDescriptionapply
(Text message, @Nullable MessageSender sender) Returns the message with the decoration applied, ormessage
if there is no decoration.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.kind()
Returns the value of thekind
record component.static MessageType.NarrationRule
of
(MessageType.NarrationRule.Kind priority) Returns the narration rule with no decoration and the specified kind.static MessageType.NarrationRule
of
(Decoration decoration, MessageType.NarrationRule.Kind kind) Returns the narration rule with the specified decoration and kind.final String
toString()
Returns a string representation of this record class.
-
Field Details
-
decoration
The field for thedecoration
record component. -
kind
The field for thekind
record component. -
CODEC
- Mappings:
Namespace Name Mixin selector official a
Lrj$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 the narration rule with no decoration and the specified kind.This does not mean the message is not narrated; this means that the message is narrated as is without any extra processing.
- Returns:
- the narration rule with no decoration and the specified kind
- Mappings:
Namespace Name Mixin selector official a
Lrj$a;a(Lrj$a$a;)Lrj$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(Decoration decoration, MessageType.NarrationRule.Kind kind) Returns the narration rule with the specified decoration and kind.- Returns:
- the narration rule with the specified decoration and kind
- Mappings:
Namespace Name Mixin selector official a
Lrj$a;a(Lrf;Lrj$a$a;)Lrj$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/text/Decoration;Lnet/minecraft/network/MessageType$NarrationRule$Kind;)Lnet/minecraft/network/MessageType$NarrationRule;
-
apply
Returns the message with the decoration applied, ormessage
if there is no decoration.- Returns:
- the message with the decoration applied, or
message
if there is no decoration - Mappings:
Namespace Name Mixin selector official a
Lrj$a;a(Lrm;Lri;)Lrm;
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/MessageSender;)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
-
kind
Returns the value of thekind
record component.- Returns:
- the value of the
kind
record component
-