Package ch.njol.skript.variables
Class Variables
java.lang.Object
ch.njol.skript.variables.Variables
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionstatic voidclose()static @Nullable ObjectcopyLocalVariables(org.bukkit.event.Event event)Creates a copy of the VariablesMap for local variables in an event.static @Nullable ObjectgetVariable(String name, @Nullable org.bukkit.event.Event e, boolean local)Returns the internal value of the requested variable.static booleanload()static intstatic @Nullable ch.njol.skript.variables.VariablesMapremoveLocals(org.bukkit.event.Event event)Removes local variables associated with given event and returns them, if they exist.static @Nullable SerializedVariable.Valuestatic SerializedVariablestatic voidsetLocalVariables(org.bukkit.event.Event event, @Nullable Object map)Sets local variables associated with given event.static voidsetVariable(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()
-