Package net.minecraft.network
Record Class MessageType.DisplayRule
java.lang.Object
java.lang.Record
net.minecraft.network.MessageType.DisplayRule
- Record Components:
decoration- the formatting of a message, orOptional.empty()if the content is displayed directly
- Enclosing class:
MessageType
A display rule for a message.
- Mappings:
Namespace Name official rc$bintermediary net/minecraft/class_2556$class_7468named net/minecraft/network/MessageType$DisplayRuleofficial bintermediary comp_797named decoration
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final com.mojang.serialization.Codec<MessageType.DisplayRule>The codec for the message display rule.private final Optional<MessageFormat>The field for thedecorationrecord component. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionapply(Text content, @Nullable ChatMessageSender sender) Returns the text to display after applying this rule on the given content and sender.Returns the value of thedecorationrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.static MessageType.DisplayRuleof()Returns a rule that displays a message's content directly.static MessageType.DisplayRuleof(MessageFormat format) Returns a rule to format the message.final StringtoString()Returns a string representation of this record class.
-
Field Details
-
decoration
The field for thedecorationrecord component. -
CODEC
The codec for the message display rule.- Mappings:
Namespace Name Mixin selector official aLrc$b;a:Lcom/mojang/serialization/Codec;intermediary field_39240Lnet/minecraft/class_2556$class_7468;field_39240:Lcom/mojang/serialization/Codec;named CODECLnet/minecraft/network/MessageType$DisplayRule;CODEC:Lcom/mojang/serialization/Codec;
-
-
Constructor Details
-
DisplayRule
-
-
Method Details
-
of
Returns a rule that displays a message's content directly. The message is displayed without any sender-related information.- Returns:
- a rule that displays a message's content directly
- Mappings:
Namespace Name Mixin selector official aLrc$b;a()Lrc$b;intermediary method_43853Lnet/minecraft/class_2556$class_7468;method_43853()Lnet/minecraft/class_2556$class_7468;named ofLnet/minecraft/network/MessageType$DisplayRule;of()Lnet/minecraft/network/MessageType$DisplayRule;
-
of
Returns a rule to format the message. It allows displaying the sender information in addition to the message content.- Returns:
- a rule to format the message
- Mappings:
Namespace Name Mixin selector official aLrc$b;a(Lra;)Lrc$b;intermediary method_43855Lnet/minecraft/class_2556$class_7468;method_43855(Lnet/minecraft/class_7463;)Lnet/minecraft/class_2556$class_7468;named ofLnet/minecraft/network/MessageType$DisplayRule;of(Lnet/minecraft/network/MessageFormat;)Lnet/minecraft/network/MessageType$DisplayRule;
-
apply
Returns the text to display after applying this rule on the given content and sender.- Returns:
- the text to display after applying this rule on the given content and sender
- Mappings:
Namespace Name Mixin selector official aLrc$b;a(Lrf;Lrb;)Lrf;intermediary method_43856Lnet/minecraft/class_2556$class_7468;method_43856(Lnet/minecraft/class_2561;Lnet/minecraft/class_7436;)Lnet/minecraft/class_2561;named applyLnet/minecraft/network/MessageType$DisplayRule;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 thedecorationrecord component.- Returns:
- the value of the
decorationrecord component
-