Package ch.njol.skript.variables
Class Variables
java.lang.Object
ch.njol.skript.variables.Variables
-
Field Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic void
close()
static @Nullable Object
copyLocalVariables(org.bukkit.event.Event event)
Creates a copy of the VariablesMap for local variables in an event.static @Nullable Object
getVariable(String name, @Nullable org.bukkit.event.Event e, boolean local)
Returns the internal value of the requested variable.static boolean
load()
static int
static @Nullable ch.njol.skript.variables.VariablesMap
removeLocals(org.bukkit.event.Event event)
Removes local variables associated with given event and returns them, if they exist.static @Nullable SerializedVariable.Value
static SerializedVariable
static void
setLocalVariables(org.bukkit.event.Event event, @Nullable Object map)
Sets local variables associated with given event.static void
setVariable(String name, @Nullable Object value, @Nullable org.bukkit.event.Event e, boolean local)
Sets a variable.static String[]
splitVariableName(String name)
-
Field Details
-
YGGDRASIL_VERSION
public static final short YGGDRASIL_VERSION- See Also:
- Constant Field Values
-
yggdrasil
-
caseInsensitiveVariables
public static boolean caseInsensitiveVariables
-
-
Method Details
-
load
public static boolean load() -
splitVariableName
-
removeLocals
public static @Nullable ch.njol.skript.variables.VariablesMap removeLocals(org.bukkit.event.Event event)Removes local variables associated with given event and returns them, if they exist.- Parameters:
event
- Event.- Returns:
- Local variables or null.
-
setLocalVariables
Sets local variables associated with given event. If the given map is null, local variables for this event will be removed if they are present! Warning: this can overwrite local variables!- Parameters:
event
- Event.map
- New local variables.
-
copyLocalVariables
Creates a copy of the VariablesMap for local variables in an event.- Parameters:
event
- The event to copy local variables from.- Returns:
- A VariablesMap copy for the local variables in an event.
-
getVariable
public static @Nullable Object getVariable(String name, @Nullable org.bukkit.event.Event e, boolean local)Returns the internal value of the requested variable.Do not modify the returned value!
- Parameters:
name
-- Returns:
- an Object for a normal Variable or a Map
for a list variable, or null if the variable is not set.
-
setVariable
public static void setVariable(String name, @Nullable Object value, @Nullable org.bukkit.event.Event e, boolean local)Sets a variable.- Parameters:
name
- The variable's name. Can be a "list variable::*" (value must be null in this case)value
- The variable's value. Use null to delete the variable.
-
serialize
-
serialize
-
close
public static void close() -
numVariables
public static int numVariables()
-