mirror of
https://github.com/KAMKEEL/CustomNPC-Plus.git
synced 2026-11-20 04:09:57 +00:00
getHookTypes is now cached imports based
This commit is contained in:
1 parent
d3f06f8866
commit
6d62a44be5
1 file changed
+1
-10
@@ -418,16 +418,7 @@ public abstract class JaninoScript<T> implements IScriptUnit {
|
||||
*/
|
||||
public Set<String> getHookTypes() {
|
||||
Set<String> types = new HashSet<>();
|
||||
for (Method method : type.getDeclaredMethods()) {
|
||||
// Add parameter types
|
||||
for (Class<?> paramType : method.getParameterTypes())
|
||||
addTypeAndEnclosingTypes(types, paramType);
|
||||
|
||||
// Add return types (in case any hook has a non-void return)
|
||||
Class<?> returnType = method.getReturnType();
|
||||
if (returnType != void.class)
|
||||
addTypeAndEnclosingTypes(types, returnType);
|
||||
}
|
||||
Collections.addAll(types, getCachedImports());
|
||||
return types;
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user