Package net.realdarkstudios.commons.util
Class LocalizedMessages
java.lang.Object
net.realdarkstudios.commons.util.LocalizedMessages
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final recordCreates a new Localization Message Keystatic class -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidsend(org.bukkit.command.CommandSender sender, LocalizedMessages.Key key, Object... formatArgs) Sends the translated key with the format argumentsstatic voidsend(org.bukkit.command.CommandSender sender, LocalizedMessages.Key key, LocalizedMessages.StyleOptions styleOverride, Object... formatArgs) Sends the translated key with the format argumentsstatic voidsendComponents(org.bukkit.command.CommandSender sender, net.md_5.bungee.api.chat.TextComponent... textComponents) static voidsendMessages(org.bukkit.command.CommandSender sender, String... messages) static voidsendWithPrefix(org.bukkit.command.CommandSender sender, LocalizedMessages.Key key, Object... formatArgs) static voidsendWithPrefix(org.bukkit.command.CommandSender sender, LocalizedMessages.Key key, LocalizedMessages.StyleOptions styleOverride, Object... formatArgs) Sends the translated key with the format argumentsstatic net.md_5.bungee.api.chat.TextComponenttranslation(LocalizedMessages.Key primaryKey, LocalizedMessages.Key backupKey, boolean withPrefix, Object... formatArgs) Returns the translated message with style optionsstatic StringtranslationC(LocalizedMessages.Key primaryKey, LocalizedMessages.Key backupKey, boolean withPrefix, Object... formatArgs)
-
Constructor Details
-
LocalizedMessages
public LocalizedMessages()
-
-
Method Details
-
send
public static void send(org.bukkit.command.CommandSender sender, LocalizedMessages.Key key, Object... formatArgs) Sends the translated key with the format arguments- Parameters:
sender- TheCommandSenderto send the message tokey- TheLocalizedMessages.Keyto sendformatArgs- The format arguments- Since:
- 0.3.1.0
-
sendWithPrefix
public static void sendWithPrefix(org.bukkit.command.CommandSender sender, LocalizedMessages.Key key, Object... formatArgs) -
sendMessages
-
sendComponents
public static void sendComponents(org.bukkit.command.CommandSender sender, net.md_5.bungee.api.chat.TextComponent... textComponents) -
send
public static void send(org.bukkit.command.CommandSender sender, LocalizedMessages.Key key, LocalizedMessages.StyleOptions styleOverride, Object... formatArgs) Sends the translated key with the format arguments- Parameters:
sender- TheCommandSenderto send the message tokey- TheLocalizedMessages.Keyto sendstyleOverride- TheLocalizedMessages.StyleOptionsthat will be applied instead of the key'sformatArgs- The format arguments- Since:
- 0.3.1.0
-
sendWithPrefix
public static void sendWithPrefix(org.bukkit.command.CommandSender sender, LocalizedMessages.Key key, LocalizedMessages.StyleOptions styleOverride, Object... formatArgs) Sends the translated key with the format arguments- Parameters:
sender- TheCommandSenderto send the message tokey- TheLocalizedMessages.Keyto sendstyleOverride- TheLocalizedMessages.StyleOptionsthat will be applied instead of the key'sformatArgs- The format arguments- Since:
- 0.3.1.0
-
translation
public static net.md_5.bungee.api.chat.TextComponent translation(@NotNull LocalizedMessages.Key primaryKey, @NotNull LocalizedMessages.Key backupKey, boolean withPrefix, Object... formatArgs) Returns the translated message with style options- Parameters:
primaryKey- The primaryLocalizedMessages.KeybackupKey- The backupLocalizedMessages.Key(used if the primary one doesn't exist)formatArgs- The format arguments- Returns:
- The
TextComponent - Since:
- 0.3.1.0
-
translationC
public static String translationC(@NotNull LocalizedMessages.Key primaryKey, @NotNull LocalizedMessages.Key backupKey, boolean withPrefix, Object... formatArgs)
-