Class MessageHandler
java.lang.Object
net.tnemc.plugincore.core.io.message.MessageHandler
The core class for translating plugin messages
- Since:
- 0.1.2.0
- Author:
- creatorfromhell
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final net.kyori.adventure.text.minimessage.MiniMessage
-
Constructor Summary
ConstructorsConstructorDescriptionMessageHandler
(TranslationProvider translator) MessageHandler
(TranslationProvider translator, net.kyori.adventure.text.minimessage.tag.resolver.TagResolver... resolvers) -
Method Summary
Modifier and TypeMethodDescriptionstatic MessageHandler
net.kyori.adventure.text.minimessage.MiniMessage
getMini()
static net.kyori.adventure.text.Component
grab
(MessageData messageData, @NotNull UUID id) Used to translate a message for a player and return the translatedComponent
.static net.kyori.adventure.text.Component
grab
(MessageData messageData, @NotNull PlayerProvider player) Used to translate a message for a player and return the translatedComponent
.static void
translate
(MessageData messageData, UUID identifier, net.kyori.adventure.audience.Audience audience) Used to translate a message for anAudience
.static void
translate
(MessageData messageData, UUID identifier, net.kyori.adventure.audience.Audience... audiences) Used to translate a message for numerous players.
-
Field Details
-
MINI_MESSAGE
-
-
Constructor Details
-
MessageHandler
-
MessageHandler
public MessageHandler(TranslationProvider translator, net.kyori.adventure.text.minimessage.tag.resolver.TagResolver... resolvers)
-
-
Method Details
-
grab
public static net.kyori.adventure.text.Component grab(MessageData messageData, @NotNull @NotNull PlayerProvider player) Used to translate a message for a player and return the translatedComponent
.- Parameters:
messageData
- The message data to utilize for this translation.player
- Theplayer
to translate this for.- Returns:
- The
Component
that is the result of the translation process of the message for the given player.
-
grab
public static net.kyori.adventure.text.Component grab(MessageData messageData, @NotNull @NotNull UUID id) Used to translate a message for a player and return the translatedComponent
.- Parameters:
messageData
- The message data to utilize for this translation.id
- Theunique identifier
of the player to translate this for.- Returns:
- The
Component
that is the result of the translation process of the message for the given player.
-
translate
public static void translate(MessageData messageData, UUID identifier, net.kyori.adventure.audience.Audience audience) Used to translate a message for anAudience
.- Parameters:
messageData
- The message data to utilize for this translation.audience
- The audience that should receive the translated message.
-
translate
public static void translate(MessageData messageData, UUID identifier, net.kyori.adventure.audience.Audience... audiences) Used to translate a message for numerous players.- Parameters:
messageData
- The message data to utilize for this translation.audiences
- The audiences that should receive the translated message.
-
getMini
-
getTranslator
-
getInstance
-