public class VariableAPI
extends java.lang.Object
| Modifier and Type | Class and Description |
|---|---|
static interface |
VariableAPI.VariableHandler
Custom VariableHandlers should implement this interface and add themselves to the handlers map, for
being used during the variable filling process
|
| Modifier and Type | Field and Description |
|---|---|
static java.util.HashMap<java.lang.String,VariableAPI.VariableHandler> |
handlers
Available VariableHandlers
|
static boolean |
phaHook
Field for checking and setting the PlaceholderAPI hook status, true = hook enabled, false = hook disabled
|
| Constructor and Description |
|---|
VariableAPI() |
| Modifier and Type | Method and Description |
|---|---|
static java.util.ArrayList<java.lang.Object> |
fill(java.lang.String msg,
int from,
org.bukkit.entity.Player plr,
java.lang.Object[] extArgs)
Fills variables in the given message from the given character recursively.
|
static java.lang.String |
fillVariables(java.lang.String msg,
org.bukkit.entity.Player plr,
java.lang.Object... extArgs)
Fills all the placeholders in the given message
|
static void |
init()
Initializes the VariableAPI.
|
public static final java.util.HashMap<java.lang.String,VariableAPI.VariableHandler> handlers
public static boolean phaHook
public static java.util.ArrayList<java.lang.Object> fill(java.lang.String msg,
int from,
org.bukkit.entity.Player plr,
java.lang.Object[] extArgs)
msg - - The message containing placeholdersfrom - - Index of character from which the variables should be filledplr - - The Player whose data should be used in the message fillingextArgs - - External object argumentspublic static java.lang.String fillVariables(java.lang.String msg,
org.bukkit.entity.Player plr,
java.lang.Object... extArgs)
msg - - The variable fillable messageplr - - Player whose data should be used for variable fillingextArgs - - External arguments passed to the VariableHandlerspublic static void init()