Package net.minecraft.network
Record Class MessageType.DisplayRule
java.lang.Object
java.lang.Record
net.minecraft.network.MessageType.DisplayRule
- Record Components:
decoration
- the decoration applied to a message, orOptional.empty()
if the content is displayed as is
- Enclosing class:
MessageType
The display rule for the message type. This contains the decoration applied
to the message.
- Mappings:
Namespace Name official rj$b
intermediary net/minecraft/class_2556$class_7468
named net/minecraft/network/MessageType$DisplayRule
official b
intermediary comp_797
named decoration
-
Field Summary
Modifier and TypeFieldDescriptionstatic final com.mojang.serialization.Codec<MessageType.DisplayRule>
private final Optional<Decoration>
The field for thedecoration
record component. -
Constructor Summary
-
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.static MessageType.DisplayRule
of()
Returns the display rule with no decoration.static MessageType.DisplayRule
of
(Decoration decoration) Returns the display rule with the specified decoration.final String
toString()
Returns a string representation of this record class.
-
Field Details
-
decoration
The field for thedecoration
record component. -
CODEC
- Mappings:
Namespace Name Mixin selector official a
Lrj$b;a:Lcom/mojang/serialization/Codec;
intermediary field_39240
Lnet/minecraft/class_2556$class_7468;field_39240:Lcom/mojang/serialization/Codec;
named CODEC
Lnet/minecraft/network/MessageType$DisplayRule;CODEC:Lcom/mojang/serialization/Codec;
-
-
Constructor Details
-
DisplayRule
-
-
Method Details
-
of
Returns the display rule with no decoration.This does not mean the message is not displayed; this means that the message is displayed as is without any extra processing.
- Returns:
- the display rule with no decoration
- Mappings:
Namespace Name Mixin selector official a
Lrj$b;a()Lrj$b;
intermediary method_43853
Lnet/minecraft/class_2556$class_7468;method_43853()Lnet/minecraft/class_2556$class_7468;
named of
Lnet/minecraft/network/MessageType$DisplayRule;of()Lnet/minecraft/network/MessageType$DisplayRule;
-
of
Returns the display rule with the specified decoration.- Returns:
- the display rule with the specified decoration
- Mappings:
Namespace Name Mixin selector official a
Lrj$b;a(Lrf;)Lrj$b;
intermediary method_43855
Lnet/minecraft/class_2556$class_7468;method_43855(Lnet/minecraft/class_7463;)Lnet/minecraft/class_2556$class_7468;
named of
Lnet/minecraft/network/MessageType$DisplayRule;of(Lnet/minecraft/text/Decoration;)Lnet/minecraft/network/MessageType$DisplayRule;
-
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$b;a(Lrm;Lri;)Lrm;
intermediary method_43856
Lnet/minecraft/class_2556$class_7468;method_43856(Lnet/minecraft/class_2561;Lnet/minecraft/class_7436;)Lnet/minecraft/class_2561;
named apply
Lnet/minecraft/network/MessageType$DisplayRule;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
-