public interface Localizable
Modifier and Type | Method and Description |
---|---|
void |
broadcast()
Broadcasts this message to all players on the server in their respective
locales.
|
void |
broadcast(Color color)
Broadcasts this message, prefixed by the given color, to all players on
the server in their respective
locales.
|
void |
broadcast(Color color,
java.lang.String... worlds)
Broadcasts this message, prefixed by the given color, to all players in
the given worlds.
|
void |
broadcast(java.lang.String... worlds)
Broadcasts this message to all players in the given worlds.
|
Localizable |
concat(Localizable localizable)
Concatenates this Localizable with another into a single new one.
|
Localizable |
concat(Localizable localizable,
java.lang.CharSequence separator)
Concatenates this Localizable with another into a single new one.
|
java.lang.String |
getKey()
Gets the key associated with this
Localizable . |
Locale |
getParent()
Gets the parent
Locale of this message. |
java.lang.Object[] |
getReplacementSequences()
Returns an array of objects which will be used to replace wildcard
sequences, in respective order.
|
java.lang.String |
localize()
Attempts to localize this message based on the server's defined locale.
|
java.lang.String |
localize(java.lang.String locale)
Attempts to localize this message in the given locale.
|
java.lang.String |
localizeFor(MGPlayer player)
Attempts to localize this message for the given
MGPlayer . |
java.lang.String |
localizeFor(java.lang.String playerName)
Attempts to localize this message for the player with the given username.
|
java.lang.String |
localizeFor(java.util.UUID playerUuid)
Attempts to localize this message for the player with the given UUID.
|
void |
sendTo(java.lang.String playerName)
Attempts to localize this message for the player with the given username
and send it to them.
|
void |
sendTo(java.lang.String playerName,
Color color)
Attempts to localize this message for the player with the given username
and send it to them prefixed by the specified chat color.
|
void |
sendTo(java.util.UUID playerUuid)
Attempts to localize this message for the player with the given username
and send it to them.
|
void |
sendTo(java.util.UUID playerUuid,
Color color)
Attempts to localize this message for the player with the given UUID and
send it to them prefixed by the specified chat color.
|
java.lang.String getKey()
Localizable
.Localizable
Locale getParent()
Locale
of this message.Locale
of this messagejava.lang.Object[] getReplacementSequences()
Localizable concat(Localizable localizable, java.lang.CharSequence separator)
localizable
- The Localizable to concatenateseparator
- The string to separate the two Localizables with. If
omitted, this will default to a space character.Localizable concat(Localizable localizable)
localizable
- The Localizable to concatenatejava.lang.String localize()
java.lang.String localize(java.lang.String locale)
locale
- The name of the locale to localize in. This should follow
the ISO 639-1 and ISO 3166-1 standards, respectively (e.g.
en_US or enUS).java.lang.String localizeFor(java.lang.String playerName) throws java.lang.IllegalArgumentException
playerName
- The username of the player to localize this message
for.java.lang.IllegalArgumentException
- If a player with the given username
cannot be foundjava.lang.String localizeFor(java.util.UUID playerUuid) throws java.lang.IllegalArgumentException
playerUuid
- The UUID of the player to localize this message for.java.lang.IllegalArgumentException
- If a player with the given UUID cannot
be foundjava.lang.String localizeFor(MGPlayer player) throws java.lang.IllegalArgumentException
MGPlayer
.player
- The MGPlayer
to localize this message forjava.lang.IllegalArgumentException
- If a player with the given username
cannot be foundvoid sendTo(java.lang.String playerName) throws java.lang.IllegalArgumentException
playerName
- The username of the player to send the localized
message tojava.lang.IllegalArgumentException
- If a player with the given username
cannot be foundvoid sendTo(java.lang.String playerName, Color color) throws java.lang.IllegalArgumentException
playerName
- The username of the player to send the localized
message tocolor
- The color to prefix the localized string withjava.lang.IllegalArgumentException
- If a player with the given username
cannot be foundvoid sendTo(java.util.UUID playerUuid) throws java.lang.IllegalArgumentException
playerUuid
- The username of the player to send the localized
message tojava.lang.IllegalArgumentException
- If a player with the given username
cannot be foundvoid sendTo(java.util.UUID playerUuid, Color color) throws java.lang.IllegalArgumentException
playerUuid
- The UUID of the player to send the localized message tocolor
- The color to prefix the localized string withjava.lang.IllegalArgumentException
- If a player with the given username
cannot be foundvoid broadcast()
void broadcast(Color color)
color
- The color to prefix the message withvoid broadcast(java.lang.String... worlds)
worlds
- The names of the worlds to broadcast tovoid broadcast(Color color, java.lang.String... worlds)
color
- The color to prefix the message withworlds
- The names of the worlds to broadcast to