Package ch.njol.skript.lang.function
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>
-
Nested Class Summary
Nested classes/interfaces inherited from interface ch.njol.skript.lang.ReturnHandler
ReturnHandler.ReturnHandlerStack -
Field Summary
Fields inherited from class ch.njol.skript.lang.function.Function
executeWithNulls -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionexecute(@NotNull FunctionEvent<?> event, @NotNull FunctionArguments arguments) Executes this function with the given parameters.T @Nullable []execute(FunctionEvent<?> event, Object[][] params) final booleanbooleanResets the return value of theFunction.@NotNull String @Nullable []final voidreturnValues(org.bukkit.event.Event event, Expression<? extends T> value) Called whenEffReturnis executedThe return type of this return handler, or null if it can't accept return values in this context (e.g.Methods inherited from class ch.njol.skript.lang.function.Function
execute, getName, getParameter, getParameters, getReturnType, getSignature, isSingle, signature, toString, typeMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface ch.njol.skript.lang.ReturnHandler
loadReturnableSectionCode, loadReturnableSectionCode, loadReturnableTrigger
-
Constructor Details
-
ScriptFunction
-
-
Method Details
-
execute
-
execute
public T execute(@NotNull @NotNull FunctionEvent<?> event, @NotNull @NotNull FunctionArguments arguments) Description copied from interface:FunctionExecutes this function with the given parameters. -
returnedKeys
- Specified by:
returnedKeysin interfaceFunction<T>- Overrides:
returnedKeysin classFunction<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:FunctionResets the return value of theFunction. Should be called right after execution.- Specified by:
resetReturnValuein interfaceFunction<T>- Specified by:
resetReturnValuein classFunction<T>- Returns:
- Whether or not the return value was successfully reset
-
returnValues
Description copied from interface:ReturnHandlerCalled whenEffReturnis executed- Specified by:
returnValuesin interfaceReturnHandler<T>- Parameters:
event- the event providing contextvalue- an expression representing the value(s) to return
-
isSingleReturnValue
public final boolean isSingleReturnValue()- Specified by:
isSingleReturnValuein interfaceReturnHandler<T>- Returns:
- whether this return handler may accept multiple return values
-
returnValueType
Description copied from interface:ReturnHandlerThe 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:
returnValueTypein interfaceReturnHandler<T>- Returns:
- the return type
-