Record Class ChatTypeDefinition
java.lang.Object
java.lang.Record
fr.fidorial.chat.ChatTypeDefinition
- Record Components:
key- the namespaced identifier of the chat typechat- how the message is shown in the chat lognarration- how the message is read out for narration/accessibility
public record ChatTypeDefinition(Key key, ChatTypeDecoration chat, ChatTypeDecoration narration)
extends Record
implements ChatType, ChatType
A complete chat type definition, ready to be sent to clients.
- Since:
- 0.1.0
-
Nested Class Summary
Nested classes/interfaces inherited from interface ChatType
ChatType.Bound -
Field Summary
Fields inherited from interface ChatType
CHAT, EMOTE_COMMAND, MSG_COMMAND_INCOMING, MSG_COMMAND_OUTGOING, SAY_COMMAND, TEAM_MSG_COMMAND_INCOMING, TEAM_MSG_COMMAND_OUTGOING -
Constructor Summary
ConstructorsConstructorDescriptionChatTypeDefinition(Key key, ChatTypeDecoration chat, ChatTypeDecoration narration) Creates an instance of aChatTypeDefinitionrecord class. -
Method Summary
Modifier and TypeMethodDescriptionstatic ChatTypeBuilderbuilder(ChatTypeDefinition definition) Returns a new builder pre-filled with the values ofdefinition.static ChatTypeBuilderReturns a new builder for the chat type identified bykey.chat()Returns the value of thechatrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.key()Returns the value of thekeyrecord component.Returns the value of thenarrationrecord component.final StringtoString()Returns a string representation of this record class.typedKey()Returns this chat type's key, typed against theminecraft:chat_typeregistry.
-
Constructor Details
-
Method Details
-
builder
Returns a new builder for the chat type identified bykey.- Parameters:
key- the namespaced identifier of the chat type- Returns:
- a new builder for the chat type identified by
key
-
builder
@Contract(value="_ -> new", pure=true) public static ChatTypeBuilder builder(ChatTypeDefinition definition) Returns a new builder pre-filled with the values ofdefinition.- Parameters:
definition- the definition to copy- Returns:
- a new builder pre-filled with the values of
definition
-
typedKey
-
toString
-
hashCode
-
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). -
key
-
chat
-
narration
-