public final class SU
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static net.milkbowl.vault.chat.Chat |
chat
The instance of current Chat provider in Vault
|
static CustomCommandMap |
cm
Instance of the CustomCommandMap used by SpigotLibs CommandAPI
|
static org.bukkit.command.ConsoleCommandSender |
cs
The main instance of the ConsoleCommandSender object.
|
static net.milkbowl.vault.economy.Economy |
econ
The instance of current Economy provider in Vault
|
static javax.script.ScriptEngine |
js
An instance of the Javascript script engine, used for the eval variable
|
static java.util.Set<java.util.UUID> |
loadedPlayers |
static org.bukkit.plugin.messaging.Messenger |
msg
The main instance of the Messenger object.
|
static net.milkbowl.vault.permission.Permission |
perm
The instance of current Permission provider in Vault
|
static ConfigFile |
pf
Player configuration file instance (players.yml file in the SpigotLib)
|
static org.bukkit.plugin.PluginManager |
pm
The main instance of the PluginManager object.
|
static java.util.Random |
rand
An instance of the Random number generator
|
static org.bukkit.scheduler.BukkitScheduler |
sch
The main instance of the BukkitScheduler object.
|
static org.bukkit.plugin.ServicesManager |
sm
The main instance of the ServicesManager object
|
static org.bukkit.Server |
srv
The main instance of the CraftServer object.
|
static Protocol |
tp
PacketAPI instance
|
static java.nio.charset.Charset |
utf8 |
static DualMap<java.lang.String,java.util.UUID> |
uuidCache
Name - UUID cache
|
static boolean |
vault
True if Vault is found on the server
|
Constructor and Description |
---|
SU() |
Modifier and Type | Method and Description |
---|---|
static void |
error(org.bukkit.command.CommandSender sender,
java.lang.Throwable err,
java.lang.String plugin,
java.lang.String author)
Sends an error report to the given sender and to console.
|
static java.lang.String |
escapeRegex(java.lang.String regex)
Escapes the given regex, without quoting it, like Pattern.quote does
|
static java.lang.String |
escapeText(java.lang.String text)
Escape multi line text to a single line one
|
static java.util.ArrayList<java.lang.String> |
fillVariables(java.lang.Iterable<java.lang.String> iterable,
java.lang.Object... vars)
Fills variables in an iterable
|
static java.lang.String |
fillVariables(java.lang.String s,
java.util.HashMap<java.lang.String,java.lang.Object> vars)
Fills variables in a String
|
static java.lang.String |
fillVariables(java.lang.String s,
java.lang.Object... vars)
Fills variables in a String
|
static java.lang.String |
fillVariablesHighlighted(java.lang.String prefix,
java.lang.String suffix,
java.lang.String s,
java.lang.Object... vars)
Fills variables in a String and highlight them by using the given prefix and suffix
|
static java.util.ArrayList<java.lang.String> |
filterStart(java.lang.Iterable<java.lang.String> data,
java.lang.String start)
Filters the startings of the given data
|
static java.util.ArrayList<java.lang.String> |
filterStart(java.lang.String[] data,
java.lang.String start)
Filters the startings of the given data
|
static java.lang.String |
getName(java.util.UUID id)
Get the name of an offline player based on it's UUID.
|
static java.util.UUID |
getOfflineUUID(java.lang.String name) |
static java.util.UUID |
getOnlineUUID(java.lang.String name) |
static int |
getPing(org.bukkit.entity.Player plr)
Get the ping of a player in milliseconds
|
static java.util.TreeMap<java.lang.String,java.lang.String> |
getPlaceholders(java.lang.String format,
java.lang.String text)
Gets the placeholders with their values from the given text
|
static org.bukkit.entity.Player |
getPlayer(java.lang.String name)
Get an online player or optionally load an offline player based on its name
|
static org.bukkit.entity.Player |
getPlayer(java.util.UUID uid) |
static ConfigFile |
getPlayerConfig(org.bukkit.entity.Player plr)
Get the configuration part of a player or the CONSOLE
|
static ConfigFile |
getPlayerConfig(java.util.UUID plr)
Get the configuration part of an online/offline player using based on his UUID, or the
configuration part of the CONSOLE, if the given UUID is null.
|
static org.bukkit.plugin.Plugin |
getPlugin(java.lang.Class cl)
Get the plugin containing the given class
|
static GameProfile |
getProfile(org.bukkit.entity.Player plr)
Get GameProfile of the given player.
|
static java.util.UUID |
getUUID(java.lang.String name)
Get the UUID of an offline player based on his name.
|
static java.util.UUID |
getUUIDExact(java.lang.String name)
Get the UUID of an offline player based on his name.
|
static org.bukkit.entity.Player |
loadPlayer(java.util.UUID uuid)
Load an offline player to be handleable like an online one.
|
static void |
loadPlayerConfig(java.util.UUID uid) |
static void |
log(org.bukkit.plugin.Plugin pl,
java.lang.Iterable<java.lang.Object>... msg)
Logs messages from the given plugin.
|
static void |
log(org.bukkit.plugin.Plugin pl,
java.lang.Object... msg)
Logs messages from the given plugin.
|
static java.util.ArrayList<java.lang.String> |
namesFromUUIDs(java.util.Collection<java.util.UUID> uuids)
Convertion of a collection of player UUIDs to the Arraylist containing the player names matching with the UUIDs.
|
static java.util.ArrayList<java.util.UUID> |
namesToUUIDs(java.util.Collection<java.lang.String> names)
Convertion of a collection of player names to the Arraylist containing the player UUIDs matching with the names.
|
static java.lang.String |
optimizeColorCodes(java.lang.String in)
Optimizes color and formatting code usage in a string by removing redundant color/formatting codes
|
static double |
rand(double min,
double max)
Generates a random number between min (inclusive) and max (exclusive)
|
static org.bukkit.Color |
randColor(double minSaturation,
double maxSaturation,
double minLuminance,
double maxLuminance)
Generate a configurable random color
|
static void |
savePlayer(org.bukkit.entity.Player plr)
Save a active offline player.
|
static void |
savePlayerConfig(java.util.UUID uid) |
static void |
savePlayerConfigNoAsync(java.util.UUID uid) |
static void |
saveResources(org.bukkit.plugin.Plugin pl,
java.lang.String... fileNames)
Save files from the given plugins jar file to its subfolder in the plugins folder.
|
static java.lang.String |
setLength(java.lang.String in,
int len)
Set maximum length of a String by cutting the redundant characters off from it
|
static java.lang.String[] |
splitPage(java.lang.String text,
int lines) |
static java.lang.String |
toCamelCase(java.lang.String name) |
static void |
transloadStream(java.io.InputStream is,
java.io.OutputStream os)
Transloads an InputStream to an OutputStream, closes the InputStream, when it's done
|
static java.lang.String |
unescapeText(java.lang.String text)
Unescape multi line to single line escaped text
|
static boolean |
unloadPlayerConfig(java.util.UUID uid)
Unloads the configuration of the given player or of the console if
uid = null
|
static void |
unloadPlugin(org.bukkit.plugin.Plugin p)
Unloads a plugin
|
public static final java.nio.charset.Charset utf8
public static net.milkbowl.vault.chat.Chat chat
public static CustomCommandMap cm
public static org.bukkit.command.ConsoleCommandSender cs
public static net.milkbowl.vault.economy.Economy econ
public static javax.script.ScriptEngine js
public static java.util.Set<java.util.UUID> loadedPlayers
public static org.bukkit.plugin.messaging.Messenger msg
public static net.milkbowl.vault.permission.Permission perm
public static ConfigFile pf
public static org.bukkit.plugin.PluginManager pm
public static java.util.Random rand
public static org.bukkit.scheduler.BukkitScheduler sch
public static org.bukkit.plugin.ServicesManager sm
public static org.bukkit.Server srv
public static Protocol tp
public static DualMap<java.lang.String,java.util.UUID> uuidCache
public static boolean vault
public static void error(org.bukkit.command.CommandSender sender, java.lang.Throwable err, java.lang.String plugin, java.lang.String author)
sender
- - The CommandSender who should receive the error reporterr
- - The errorplugin
- - The plugin where the error appearedauthor
- - The author name, which will be searched in the error reportpublic static java.lang.String escapeRegex(java.lang.String regex)
regex
- - The escapable regexpublic static java.lang.String escapeText(java.lang.String text)
text
- multi line escapeable text inputpublic static java.lang.String fillVariables(java.lang.String s, java.util.HashMap<java.lang.String,java.lang.Object> vars)
s
- - The Stringvars
- - The variables and their values, which should be filledpublic static java.lang.String fillVariables(java.lang.String s, java.lang.Object... vars)
s
- - The Stringvars
- - The variables and their values, which should be filledpublic static java.util.ArrayList<java.lang.String> fillVariables(java.lang.Iterable<java.lang.String> iterable, java.lang.Object... vars)
iterable
- - The iterablevars
- - The variables and their values, which should be filledpublic static java.lang.String fillVariablesHighlighted(java.lang.String prefix, java.lang.String suffix, java.lang.String s, java.lang.Object... vars)
s
- - The Stringprefix
- - The prefix used for highlightingsuffix
- - The suffix used for highlightingvars
- - The variables and their values, which should be filledpublic static java.util.ArrayList<java.lang.String> filterStart(java.lang.String[] data, java.lang.String start)
data
- - The data to be filteredstart
- - Filter every string which starts with this onepublic static java.util.ArrayList<java.lang.String> filterStart(java.lang.Iterable<java.lang.String> data, java.lang.String start)
data
- - The data to be filteredstart
- - Filter every string which starts with this onepublic static java.lang.String getName(java.util.UUID id)
id
- UUID of the target playerpublic static java.util.UUID getOfflineUUID(java.lang.String name)
public static java.util.UUID getOnlineUUID(java.lang.String name)
public static int getPing(org.bukkit.entity.Player plr)
plr
- target playerpublic static java.util.TreeMap<java.lang.String,java.lang.String> getPlaceholders(java.lang.String format, java.lang.String text)
format
- - The texts placeholder arrangement formattext
- - The textpublic static org.bukkit.entity.Player getPlayer(java.lang.String name)
name
- name of the player, which should be got / active.public static org.bukkit.entity.Player getPlayer(java.util.UUID uid)
public static ConfigFile getPlayerConfig(org.bukkit.entity.Player plr)
plr
- the player, whos configuration part will be returnedpublic static ConfigFile getPlayerConfig(java.util.UUID plr)
plr
- the UUID of the online/offline playerpublic static org.bukkit.plugin.Plugin getPlugin(java.lang.Class cl)
cl
- - The checkable classpublic static GameProfile getProfile(org.bukkit.entity.Player plr)
plr
- target playerpublic static java.util.UUID getUUID(java.lang.String name)
name
- name of the target playerpublic static java.util.UUID getUUIDExact(java.lang.String name)
name
- name of the target playerpublic static org.bukkit.entity.Player loadPlayer(java.util.UUID uuid)
uuid
- uuid of the loadable offline playerpublic static void loadPlayerConfig(java.util.UUID uid)
public static void log(org.bukkit.plugin.Plugin pl, java.lang.Object... msg)
pl
- - The plugin who wants to log the messagemsg
- - The message which should be loggedpublic static void log(org.bukkit.plugin.Plugin pl, java.lang.Iterable<java.lang.Object>... msg)
pl
- - The plugin who wants to log the messagemsg
- - The message which should be loggedpublic static java.util.ArrayList<java.lang.String> namesFromUUIDs(java.util.Collection<java.util.UUID> uuids)
uuids
- collection of player uuids which will be converted to namespublic static java.util.ArrayList<java.util.UUID> namesToUUIDs(java.util.Collection<java.lang.String> names)
names
- collection of player names which will be converted to UUIDspublic static java.lang.String optimizeColorCodes(java.lang.String in)
in
- input message containing color and formatting codespublic static double rand(double min, double max)
min
- - Minimal value of the random numbermax
- - Maximal value of the random numberpublic static org.bukkit.Color randColor(double minSaturation, double maxSaturation, double minLuminance, double maxLuminance)
minSaturation
- - Minimal saturation (0-1)maxSaturation
- - Maximal saturation (0-1)minLuminance
- - Minimal luminance (0-1)maxLuminance
- - Maximal luminance (0-1)public static void savePlayer(org.bukkit.entity.Player plr)
plr
- Loaded offline players Player objectpublic static void savePlayerConfig(java.util.UUID uid)
public static void savePlayerConfigNoAsync(java.util.UUID uid)
public static void saveResources(org.bukkit.plugin.Plugin pl, java.lang.String... fileNames)
pl
- instane of the pluginfileNames
- names of the saveable filespublic static java.lang.String setLength(java.lang.String in, int len)
in
- input Stringlen
- maximum lengthpublic static java.lang.String[] splitPage(java.lang.String text, int lines)
public static java.lang.String toCamelCase(java.lang.String name)
public static void transloadStream(java.io.InputStream is, java.io.OutputStream os) throws java.io.IOException
is
- - The InputStreamos
- - The OutputStreamjava.io.IOException
public static java.lang.String unescapeText(java.lang.String text)
text
- multi line escaped text inputpublic static boolean unloadPlayerConfig(java.util.UUID uid)
uid
- - The UUID of the player, or null for consolepublic static void unloadPlugin(org.bukkit.plugin.Plugin p)
p
- - The unloadable plugin