Package net.minecraft.network.chat
Record Class ChatTypeDecoration
java.lang.Object
java.lang.Record
net.minecraft.network.chat.ChatTypeDecoration
public record ChatTypeDecoration(String translationKey, List<ChatTypeDecoration.Parameter> parameters, Style style)
extends Record
-
Nested Class Summary
-
Field Summary
Modifier and TypeFieldDescriptionstatic final com.mojang.serialization.Codec<ChatTypeDecoration>
private final List<ChatTypeDecoration.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
ConstructorDescriptionChatTypeDecoration
(String translationKey, List<ChatTypeDecoration.Parameter> parameters, Style style) Creates an instance of aChatTypeDecoration
record class. -
Method Summary
Modifier and TypeMethodDescriptiondecorate
(Component p_241301_, ChatType.Bound p_241391_) final boolean
Indicates whether some other object is "equal to" this one.final int
hashCode()
Returns a hash code value for this object.static ChatTypeDecoration
incomingDirectMessage
(String p_239425_) static ChatTypeDecoration
outgoingDirectMessage
(String p_240772_) Returns the value of theparameters
record component.private Component[]
resolveParameters
(Component p_241365_, ChatType.Bound p_241559_) style()
Returns the value of thestyle
record component.static ChatTypeDecoration
teamMessage
(String p_239095_) final String
toString()
Returns a string representation of this record class.Returns the value of thetranslationKey
record component.static ChatTypeDecoration
withSender
(String p_239223_)
-
Field Details
-
translationKey
The field for thetranslationKey
record component. -
parameters
The field for theparameters
record component. -
style
The field for thestyle
record component. -
CODEC
-
-
Constructor Details
-
ChatTypeDecoration
public ChatTypeDecoration(String translationKey, List<ChatTypeDecoration.Parameter> parameters, Style style) Creates an instance of aChatTypeDecoration
record class.- Parameters:
translationKey
- the value for thetranslationKey
record componentparameters
- the value for theparameters
record componentstyle
- the value for thestyle
record component
-
-
Method Details
-
withSender
-
incomingDirectMessage
-
outgoingDirectMessage
-
teamMessage
-
decorate
-
resolveParameters
-
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
-