mirror of
https://github.com/2006-Scape/Parabot.git
synced 2026-07-06 08:39:33 +00:00
Improved code
This commit is contained in:
@@ -4,6 +4,7 @@ import org.parabot.core.asm.hooks.HookFile;
|
|||||||
import org.parabot.core.asm.interfaces.Injectable;
|
import org.parabot.core.asm.interfaces.Injectable;
|
||||||
import org.parabot.core.asm.wrappers.*;
|
import org.parabot.core.asm.wrappers.*;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
import java.util.Collections;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -37,39 +38,27 @@ public abstract class HookParser {
|
|||||||
ArrayList<Injectable> injectables = new ArrayList<Injectable>();
|
ArrayList<Injectable> injectables = new ArrayList<Injectable>();
|
||||||
Interface[] interfaces = getInterfaces();
|
Interface[] interfaces = getInterfaces();
|
||||||
if (interfaces != null) {
|
if (interfaces != null) {
|
||||||
for (Interface inf : interfaces) {
|
Collections.addAll(injectables, interfaces);
|
||||||
injectables.add(inf);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
Getter[] getters = getGetters();
|
Getter[] getters = getGetters();
|
||||||
if (getters != null) {
|
if (getters != null) {
|
||||||
for (Getter get : getters) {
|
Collections.addAll(injectables, getters);
|
||||||
injectables.add(get);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
Setter[] setters = getSetters();
|
Setter[] setters = getSetters();
|
||||||
if (setters != null) {
|
if (setters != null) {
|
||||||
for (Setter set : setters) {
|
Collections.addAll(injectables, setters);
|
||||||
injectables.add(set);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
Super[] supers = getSupers();
|
Super[] supers = getSupers();
|
||||||
if (supers != null) {
|
if (supers != null) {
|
||||||
for (Super sup : supers) {
|
Collections.addAll(injectables, supers);
|
||||||
injectables.add(sup);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
Invoker[] invokers = getInvokers();
|
Invoker[] invokers = getInvokers();
|
||||||
if (invokers != null) {
|
if (invokers != null) {
|
||||||
for (Invoker vok : invokers) {
|
Collections.addAll(injectables, invokers);
|
||||||
injectables.add(vok);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
Callback[] callbacks = getCallbacks();
|
Callback[] callbacks = getCallbacks();
|
||||||
if (callbacks != null) {
|
if (callbacks != null) {
|
||||||
for (Callback callback : callbacks) {
|
Collections.addAll(injectables, callbacks);
|
||||||
injectables.add(callback);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
return injectables.toArray(new Injectable[injectables.size()]);
|
return injectables.toArray(new Injectable[injectables.size()]);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user