Class Variables

java.lang.Object
ch.njol.skript.variables.Variables

public abstract class Variables extends Object
  • Field Details

    • YGGDRASIL_VERSION

      public static final short YGGDRASIL_VERSION
      See Also:
      Constant Field Values
    • yggdrasil

      public static final Yggdrasil yggdrasil
    • caseInsensitiveVariables

      public static boolean caseInsensitiveVariables
  • Method Details

    • load

      public static boolean load()
    • splitVariableName

      public static String[] splitVariableName(String name)
    • 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

      public static void setLocalVariables(org.bukkit.event.Event event, @Nullable Object map)
      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

      public static @Nullable Object copyLocalVariables(org.bukkit.event.Event event)
      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

      public static SerializedVariable serialize(String name, @Nullable Object value)
    • serialize

      public static @Nullable SerializedVariable.Value serialize(@Nullable Object value)
    • close

      public static void close()
    • numVariables

      public static int numVariables()