Contents
- Description
- Field Summary
- Constructor Summary
- Method Summary
- Field Details
- Constructor Details
- Method Details
- param(String, String)
- param(String, boolean)
- param(String, double)
- param(String, int)
- param(String, long)
- param(String, float)
- param(String, Message)
- bold(boolean)
- italic(boolean)
- monospace(boolean)
- strikethrough(boolean)
- color(String)
- color(Color)
- link(String)
- insert(Message)
- insert(String)
- insertAll(Message...)
- insertAll(List)
- getRawText()
- getMessageId()
- getColor()
- getChildren()
- getAnsiMessage()
- getFormattedMessage()
- toString()
- empty()
- translation(String)
- raw(String)
- parse(String)
- join(Message...)
Class Message
java.lang.Object
com.hypixel.hytale.server.core.Message
A message that can be sent to a
IMessageReceiver.
Can contain raw text, formatted text, links, an image, an icon...-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final FunctionCodec<FormattedMessage, Message> The codec used to parse and writeMessageinstances -
Constructor Summary
ConstructorsConstructorDescriptionMessage(FormattedMessage message) A constructor for aMessageinstance, which takes in an existing message contents -
Method Summary
Modifier and TypeMethodDescriptionbold(boolean bold) Called to set the message as being boldCalled to set the message color from the givenColorvalueCalled to set the message color from the givenStringhex valuestatic Messageempty()Creates a new Message instance without any message in the root nodegetColor()Called to insert the givenMessageas a child of this messageCalled to insert the givenStringvalue as a child of this messageCalled to insert the given array of messages as children of this messageCalled to insert the given collection of messages as children of this messageitalic(boolean italic) Called to set the message as being italicstatic MessageJoin together messages into a single message.Called to set a URL on the message, from the given URL valuemonospace(boolean monospace) Called to set the message as being monospaceAssigns the givenbooleanvalue as a parameter for the given keyAssigns the givendoublevalue as a parameter for the given keyAssigns the givenfloatvalue as a parameter for the given keyAssigns the givenintvalue as a parameter for the given keyAssigns the givenlongvalue as a parameter for the given keyAssigns the givenMessagevalue as a parameter for the given keyAssigns the givenStringvalue as a parameter for the given keystatic MessageCreates a newMessageinstance by parsing the provided message as aBsonDocumentstatic MessageCreates a newMessageinstance with a raw string message The usage of Message#build should be always preferredstrikethrough(boolean strikethrough) Called to set the message as having a strikethroughtoString()static Messagetranslation(String messageId) Creates a new Message instance with a message from the i18n translation files
-
Field Details
-
CODEC
The codec used to parse and writeMessageinstances
-
-
Constructor Details
-
Message
A constructor for aMessageinstance, which takes in an existing message contents- Parameters:
message- TheFormattedMessagecontents of the message
-
-
Method Details
-
param
-
param
-
param
-
param
-
param
-
param
-
param
-
bold
-
italic
-
monospace
-
strikethrough
-
color
-
color
-
link
-
insert
-
insert
-
insertAll
-
insertAll
-
getRawText
- Returns:
- the raw text of this message
-
getMessageId
- Returns:
- the message ID of this message
-
getColor
- Returns:
- the color of this message, as a HEX value
-
getChildren
-
getAnsiMessage
- Returns:
- the contents of the message into a formatted string
-
getFormattedMessage
-
toString
-
empty
Creates a new Message instance without any message in the root node- Returns:
- the Message instance
-
translation
-
raw
-
parse
-
join
-