Cleanup reflection parameters
This commit is contained in:
parent
578f4e1b9e
commit
e5038fce31
20 changed files with 73 additions and 131 deletions
|
|
@ -1,27 +0,0 @@
|
|||
package net.frankheijden.serverutils.bungee.reflection;
|
||||
|
||||
import static net.frankheijden.serverutils.common.reflection.FieldParam.fieldOf;
|
||||
import static net.frankheijden.serverutils.common.reflection.ReflectionUtils.getAllFields;
|
||||
import static net.frankheijden.serverutils.common.reflection.VersionParam.ALL_VERSIONS;
|
||||
|
||||
import java.lang.reflect.Field;
|
||||
import java.util.Map;
|
||||
|
||||
public class RPlugin {
|
||||
|
||||
private static Class<?> pluginClass;
|
||||
private static Map<String, Field> fields;
|
||||
|
||||
static {
|
||||
try {
|
||||
pluginClass = Class.forName("net.md_5.bungee.api.plugin.Plugin");
|
||||
fields = getAllFields(pluginClass,
|
||||
fieldOf("plugins", ALL_VERSIONS),
|
||||
fieldOf("toLoad", ALL_VERSIONS),
|
||||
fieldOf("commandsByPlugin", ALL_VERSIONS),
|
||||
fieldOf("listenersByPlugin", ALL_VERSIONS));
|
||||
} catch (Exception ex) {
|
||||
ex.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -3,7 +3,6 @@ package net.frankheijden.serverutils.bungee.reflection;
|
|||
import static net.frankheijden.serverutils.common.reflection.FieldParam.fieldOf;
|
||||
import static net.frankheijden.serverutils.common.reflection.ReflectionUtils.get;
|
||||
import static net.frankheijden.serverutils.common.reflection.ReflectionUtils.getAllFields;
|
||||
import static net.frankheijden.serverutils.common.reflection.VersionParam.ALL_VERSIONS;
|
||||
|
||||
import java.lang.reflect.Constructor;
|
||||
import java.lang.reflect.Field;
|
||||
|
|
@ -27,8 +26,8 @@ public class RPluginClassLoader {
|
|||
constructor = loaderClass.getDeclaredConstructor(ProxyServer.class, PluginDescription.class, URL[].class);
|
||||
constructor.setAccessible(true);
|
||||
fields = getAllFields(loaderClass,
|
||||
fieldOf("allLoaders", ALL_VERSIONS),
|
||||
fieldOf("plugin", ALL_VERSIONS));
|
||||
fieldOf("allLoaders"),
|
||||
fieldOf("plugin"));
|
||||
} catch (Exception ex) {
|
||||
ex.printStackTrace();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -3,7 +3,6 @@ package net.frankheijden.serverutils.bungee.reflection;
|
|||
import static net.frankheijden.serverutils.common.reflection.FieldParam.fieldOf;
|
||||
import static net.frankheijden.serverutils.common.reflection.ReflectionUtils.get;
|
||||
import static net.frankheijden.serverutils.common.reflection.ReflectionUtils.getAllFields;
|
||||
import static net.frankheijden.serverutils.common.reflection.VersionParam.ALL_VERSIONS;
|
||||
|
||||
import com.google.common.collect.Multimap;
|
||||
|
||||
|
|
@ -24,11 +23,11 @@ public class RPluginManager {
|
|||
try {
|
||||
pluginManagerClass = Class.forName("net.md_5.bungee.api.plugin.PluginManager");
|
||||
fields = getAllFields(pluginManagerClass,
|
||||
fieldOf("yaml", ALL_VERSIONS),
|
||||
fieldOf("plugins", ALL_VERSIONS),
|
||||
fieldOf("commandMap", ALL_VERSIONS),
|
||||
fieldOf("toLoad", ALL_VERSIONS),
|
||||
fieldOf("commandsByPlugin", ALL_VERSIONS));
|
||||
fieldOf("yaml"),
|
||||
fieldOf("plugins"),
|
||||
fieldOf("commandMap"),
|
||||
fieldOf("toLoad"),
|
||||
fieldOf("commandsByPlugin"));
|
||||
} catch (Exception ex) {
|
||||
ex.printStackTrace();
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue