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
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final com.mojang.serialization.Codec<ChatTypeDecoration> private final List<ChatTypeDecoration.Parameter> The field for theparametersrecord component.static final StreamCodec<RegistryFriendlyByteBuf, ChatTypeDecoration> private final StyleThe field for thestylerecord component.private final StringThe field for thetranslationKeyrecord component. -
Constructor Summary
ConstructorsConstructorDescriptionChatTypeDecoration(String translationKey, List<ChatTypeDecoration.Parameter> parameters, Style style) Creates an instance of aChatTypeDecorationrecord class. -
Method Summary
Modifier and TypeMethodDescriptiondecorate(Component content, ChatType.Bound boundChatType) final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.static ChatTypeDecorationincomingDirectMessage(String translationKey) static ChatTypeDecorationoutgoingDirectMessage(String translationKey) Returns the value of theparametersrecord component.private Component[]resolveParameters(Component content, ChatType.Bound boundChatType) style()Returns the value of thestylerecord component.static ChatTypeDecorationteamMessage(String translationKey) final StringtoString()Returns a string representation of this record class.Returns the value of thetranslationKeyrecord component.static ChatTypeDecorationwithSender(String translationKey)
-
Field Details
-
translationKey
The field for thetranslationKeyrecord component. -
parameters
The field for theparametersrecord component. -
style
The field for thestylerecord component. -
CODEC
-
STREAM_CODEC
-
-
Constructor Details
-
ChatTypeDecoration
public ChatTypeDecoration(String translationKey, List<ChatTypeDecoration.Parameter> parameters, Style style) Creates an instance of aChatTypeDecorationrecord class.- Parameters:
translationKey- the value for thetranslationKeyrecord componentparameters- the value for theparametersrecord componentstyle- the value for thestylerecord 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 thetranslationKeyrecord component.- Returns:
- the value of the
translationKeyrecord component
-
parameters
Returns the value of theparametersrecord component.- Returns:
- the value of the
parametersrecord component
-
style
Returns the value of thestylerecord component.- Returns:
- the value of the
stylerecord component
-