Class ScriptFunction<T>

java.lang.Object
ch.njol.skript.lang.function.Function<T>
ch.njol.skript.lang.function.ScriptFunction<T>
All Implemented Interfaces:
ReturnHandler<T>, Function<T>

public class ScriptFunction<T> extends Function<T> implements ReturnHandler<T>
  • Constructor Details

  • Method Details

    • execute

      public T @Nullable [] execute(FunctionEvent<?> event, Object[][] params)
      Specified by:
      execute in class Function<T>
    • execute

      public T execute(@NotNull @NotNull FunctionEvent<?> event, @NotNull @NotNull FunctionArguments arguments)
      Description copied from interface: Function
      Executes this function with the given parameters.
      Specified by:
      execute in interface Function<T>
      Parameters:
      event - The event that is associated with this function execution.
      arguments - The arguments to execute the function with.
      Returns:
      The return value.
    • returnedKeys

      @NotNull public @NotNull String @Nullable [] returnedKeys()
      Specified by:
      returnedKeys in interface Function<T>
      Overrides:
      returnedKeys in class Function<T>
      Returns:
      The keys of the values returned by this function, or null if no keys are returned.
    • 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 interface Function<T>
      Specified by:
      resetReturnValue in class Function<T>
      Returns:
      Whether or not the return value was successfully reset
    • returnValues

      public final void returnValues(org.bukkit.event.Event event, Expression<? extends T> value)
      Description copied from interface: ReturnHandler
      Called when EffReturn is executed
      Specified by:
      returnValues in interface ReturnHandler<T>
      Parameters:
      event - the event providing context
      value - an expression representing the value(s) to return
    • isSingleReturnValue

      public final boolean isSingleReturnValue()
      Specified by:
      isSingleReturnValue in interface ReturnHandler<T>
      Returns:
      whether this return handler may accept multiple return values
    • returnValueType

      @Nullable public final @Nullable Class<? extends T> returnValueType()
      Description copied from interface: ReturnHandler
      The return type of this return handler, or null if it can't accept return values in this context (e.g. a function without a return type).
      Specified by:
      returnValueType in interface ReturnHandler<T>
      Returns:
      the return type