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
ConstructorDescriptionScriptFunction
(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 boolean
boolean
Resets the return value of theFunction
.final void
returnValues
(org.bukkit.event.Event event, Expression<? extends T> value) Called whenEffReturn
is executedThe return type of this return handler, or null if it can't accept return values in this context (e.g.final void
setReturnValue
(T[] values) Deprecated.Methods inherited from class ch.njol.skript.lang.function.Function
execute, getName, getParameter, getParameters, getReturnType, getSignature, isSingle, toString
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface ch.njol.skript.lang.ReturnHandler
loadReturnableSectionCode, loadReturnableSectionCode, loadReturnableTrigger
-
Constructor Details
-
ScriptFunction
Deprecated. -
ScriptFunction
-
-
Method Details
-
execute
Description copied from class:Function
Executes this function with given parameters. Usually, usingFunction.execute(Object[][])
is better; it handles optional arguments and function event creation automatically.- Specified by:
execute
in 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:Function
Resets the return value of theFunction
. Should be called right after execution.- Specified by:
resetReturnValue
in classFunction<T>
- Returns:
- Whether or not the return value was successfully reset
-
returnValues
Description copied from interface:ReturnHandler
Called whenEffReturn
is executed- Specified by:
returnValues
in interfaceReturnHandler<T>
- Parameters:
event
- the event providing contextvalue
- an expression representing the value(s) to return
-
isSingleReturnValue
public final boolean isSingleReturnValue()- Specified by:
isSingleReturnValue
in interfaceReturnHandler<T>
- Returns:
- whether this return handler may accept multiple return values
-
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 interfaceReturnHandler<T>
- Returns:
- the return type
-
ScriptFunction(Signature, SectionNode)