public interface Lang
extends com.codelanx.commons.config.LangFile
Modifier and Type | Field and Description |
---|---|
static com.codelanx.commons.config.LangFile |
DEFAULT_DYNAMIC |
Modifier and Type | Method and Description |
---|---|
static String |
color(String color)
Automatically translates strings that contain color codes using the
'
& ' symbol |
static Lang |
createLang(String format)
Returns a raw Lang object that can be used for dynamic creation of Lang
variables
|
static Lang |
defaultFormat(String option)
Returns a Lang object representing the default formatting for all
CodelanxLib plugins.
|
default String |
formatAndColor(Object... args)
Formats a
LangFile enum constant with the supplied arguments, and
colors it |
default File |
getFileLocation() |
Lang |
getFormat()
Returns the format specifier for this
LangFile file. |
static Lang |
getFormat(Plugin plugin)
Returns an acceptable message format for the plugin at hand
|
static void |
sendMessage(CommandSender target,
Lang format,
com.codelanx.commons.config.LangFile message,
Object... args)
Sends a message but does not include
getFormat(org.bukkit.plugin.Plugin) , instead it
uses a supplied format |
static void |
sendMessage(CommandSender target,
Lang message,
Object... args)
Sends a formatted string and prepends the
getFormat(org.bukkit.plugin.Plugin) to
it. |
static void |
sendMessage(OfflinePlayer target,
Lang format,
com.codelanx.commons.config.LangFile message,
Object... args) |
static void |
sendMessage(OfflinePlayer target,
Lang message,
Object... args) |
static void |
sendMessage(Player target,
Lang format,
com.codelanx.commons.config.LangFile message,
Object... args) |
static void |
sendMessage(Player target,
Lang message,
Object... args) |
static void |
sendRawMessage(CommandSender target,
Lang message,
Object... args)
Sends a raw message without additional formatting aside from translating
color codes
|
static void |
sendRawMessage(OfflinePlayer target,
Lang message,
Object... args) |
static void |
sendRawMessage(Player target,
Lang message,
Object... args) |
static void |
sendTitle(Player target,
com.codelanx.commons.config.LangFile message,
Object... args)
Issues a "title" command to a
Player target with the passed Lang |
static void |
tellRaw(Player target,
com.codelanx.commons.config.LangFile message,
Object... args)
Issues a "tellRaw" to a
Player target with the supplied Lang |
static Lang getFormat(Plugin plugin)
plugin
- A Plugin
that needs a formatLangFile
formatLang getFormat()
LangFile
file. This should be
a constant in the enum and represent a value that is used for all
messages universally.LangFile
static Lang defaultFormat(String option)
option
parameter can be supplemented
with null
which will default to "CL-Lib". The returned format is:
"&f[&9" + option == null ? "CL-Lib" : option + "&f] %amp;s"
option
- The optional "title" string for the formatLangFile
object representing the default formatstatic String color(String color)
&
' symbolcolor
- String with un-converted color codesstatic void sendMessage(CommandSender target, Lang message, Object... args)
getFormat(org.bukkit.plugin.Plugin)
to
it.target
- The target to send tomessage
- The message to colorize and sendargs
- Arguments to supply to the LangFile
messagestatic void sendMessage(CommandSender target, Lang format, com.codelanx.commons.config.LangFile message, Object... args)
getFormat(org.bukkit.plugin.Plugin)
, instead it
uses a supplied formattarget
- The target to send toformat
- The format providedmessage
- The message to colorize and sendargs
- Arguments to supply to the LangFile
messagestatic void sendRawMessage(CommandSender target, Lang message, Object... args)
target
- The target to send tomessage
- The message to colorize and sendargs
- Arguments to supply to the LangFile
messagestatic void tellRaw(Player target, com.codelanx.commons.config.LangFile message, Object... args)
Player
target with the supplied Langtarget
- The Player
to send the JSON message tomessage
- A LangFile
representing a JSON payloadargs
- The arguments for the passed LangFile
static void sendTitle(Player target, com.codelanx.commons.config.LangFile message, Object... args)
Player
target with the passed Langtarget
- The Player
to send the JSON title tomessage
- A LangFile
representing a JSON payload for the titleargs
- The arguments for the passed LangFile
default String formatAndColor(Object... args)
LangFile
enum constant with the supplied arguments, and
colors itargs
- The arguments to supplystatic Lang createLang(String format)
createLang
in interface com.codelanx.commons.config.LangFile
format
- The string to wrap in a LangFile
objectLangFile
object that willstatic void sendMessage(OfflinePlayer target, Lang format, com.codelanx.commons.config.LangFile message, Object... args)
static void sendMessage(OfflinePlayer target, Lang message, Object... args)
static void sendRawMessage(OfflinePlayer target, Lang message, Object... args)
static void sendMessage(Player target, Lang format, com.codelanx.commons.config.LangFile message, Object... args)
default File getFileLocation()
getFileLocation
in interface com.codelanx.commons.config.InfoFile
Copyright © 2017. All rights reserved.