Class JavaFunction<T>

java.lang.Object
ch.njol.skript.lang.function.Function<T>
ch.njol.skript.lang.function.JavaFunction<T>
Direct Known Subclasses:
SimpleJavaFunction

public abstract class JavaFunction<T> extends Function<T>
  • Constructor Details

    • JavaFunction

      public JavaFunction(Signature<T> sign)
    • JavaFunction

      public JavaFunction(String name, Parameter<?>[] parameters, ClassInfo<T> returnType, boolean single)
  • Method Details

    • execute

      public abstract @Nullable T[] execute(FunctionEvent<?> e, Object[][] params)
      Description copied from class: Function
      Executes this function with given parameters. Usually, using Function.execute(Object[][]) is better; it handles optional arguments and function event creation automatically.
      Specified by:
      execute in class Function<T>
      Parameters:
      e - Associated function event. This is usually created by Skript.
      params - Function parameters. There must be Signature.getMaxParameters() amount of them, and you need to manually handle default values.
      Returns:
      Function return value(s).
    • description

      public JavaFunction<T> description(String... description)
      Only used for Skript's documentation.
      Returns:
      This JavaFunction object
    • examples

      public JavaFunction<T> examples(String... examples)
      Only used for Skript's documentation.
      Returns:
      This JavaFunction object
    • since

      public JavaFunction<T> since(String since)
      Only used for Skript's documentation.
      Returns:
      This JavaFunction object
    • getDescription

      public @Nullable String[] getDescription()
    • getExamples

      public @Nullable String[] getExamples()
    • getSince

      public @Nullable String getSince()
    • resetReturnValue

      public boolean resetReturnValue()
      Description copied from class: Function
      Resets the return value of the Function. Should be called right after execution.
      Specified by:
      resetReturnValue in class Function<T>
      Returns:
      Whether or not the return value was successfully reset