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>
-
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
ConstructorsConstructorDescriptionScriptFunction(Signature<T> sign, SectionNode node) ScriptFunction(Signature<T> sign, Script script, SectionNode node) Deprecated. -
Method Summary
Modifier and TypeMethodDescriptionT @Nullable []execute(FunctionEvent<?> e, Object[][] params) Executes this function with given parameters.final booleanbooleanResets the return value of theFunction.final voidreturnValues(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.final voidsetReturnValue(T[] values) Deprecated.Methods inherited from class ch.njol.skript.lang.function.Function
execute, getName, getParameter, getParameters, getReturnType, getSignature, isSingle, toStringMethods 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
Deprecated. -
ScriptFunction
-
-
Method Details
-
execute
Description copied from class:FunctionExecutes this function with given parameters. Usually, usingFunction.execute(Object[][])is better; it handles optional arguments and function event creation automatically.- Specified by:
executein classFunction<T>- Parameters:
e- Associated function event. This is usually created by Skript.params- Function parameters. There must beSignature.getMaxParameters()amount of them, and you need to manually handle default values.- Returns:
- Function return value(s).
-
setReturnValue
Deprecated. -
resetReturnValue
public boolean resetReturnValue()Description copied from class:FunctionResets the return value of theFunction. Should be called right after execution.- 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
-
ScriptFunction(Signature, SectionNode)