Package ch.njol.skript.lang.function
Class JavaFunction<T>
java.lang.Object
ch.njol.skript.lang.function.Function<T>
ch.njol.skript.lang.function.JavaFunction<T>
- Direct Known Subclasses:
SimpleJavaFunction
-
Field Summary
Fields inherited from class ch.njol.skript.lang.function.Function
executeWithNulls
-
Constructor Summary
ConstructorDescriptionJavaFunction
(Signature<T> sign) JavaFunction
(String name, Parameter<?>[] parameters, ClassInfo<T> returnType, boolean single) JavaFunction
(String name, Parameter<?>[] parameters, ClassInfo<T> returnType, boolean single, @Nullable Contract contract) -
Method Summary
Modifier and TypeMethodDescriptiondescription
(String... description) Only used for Skript's documentation.Only used for Skript's documentation.abstract T[]
execute
(FunctionEvent<?> e, Object[][] params) Executes this function with given parameters.@Nullable String[]
@Nullable String[]
@Nullable String[]
@Nullable String
getSince()
Only used for Skript's documentation.boolean
Resets the return value of theFunction
.Only used for Skript's documentation.Methods inherited from class ch.njol.skript.lang.function.Function
execute, getName, getParameter, getParameters, getReturnType, getSignature, isSingle, toString
-
Constructor Details
-
JavaFunction
-
JavaFunction
-
JavaFunction
-
-
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).
-
description
Only used for Skript's documentation.- Returns:
- This JavaFunction object
-
examples
Only used for Skript's documentation.- Returns:
- This JavaFunction object
-
keywords
Only used for Skript's documentation.- Parameters:
keywords
-- Returns:
- This JavaFunction object
-
since
Only used for Skript's documentation.- Returns:
- This JavaFunction object
-
getDescription
-
getExamples
-
getKeywords
-
getSince
-
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
-