本文整理汇总了Java中cpw.mods.fml.relauncher.IFMLLoadingPlugin类的典型用法代码示例。如果您正苦于以下问题:Java IFMLLoadingPlugin类的具体用法?Java IFMLLoadingPlugin怎么用?Java IFMLLoadingPlugin使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
IFMLLoadingPlugin类属于cpw.mods.fml.relauncher包,在下文中一共展示了IFMLLoadingPlugin类的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: injectDeobfPlugin
import cpw.mods.fml.relauncher.IFMLLoadingPlugin; //导入依赖的package包/类
private void injectDeobfPlugin() {
try {
Class<?> wrapperClass = Class.forName("cpw.mods.fml.relauncher.CoreModManager$FMLPluginWrapper");
Constructor wrapperConstructor = wrapperClass.getConstructor(String.class, IFMLLoadingPlugin.class, File.class, Integer.TYPE, String[].class);
Field f_loadPlugins = CoreModManager.class.getDeclaredField("loadPlugins");
wrapperConstructor.setAccessible(true);
f_loadPlugins.setAccessible(true);
((List)f_loadPlugins.get(null)).add(2, wrapperConstructor.newInstance("CCCDeobfPlugin", new MCPDeobfuscationTransformer.LoadPlugin(), null, 0, new String[0]));
} catch (Exception e) {
logger.error("Failed to inject MCPDeobfuscation Transformer", e);
}
}
示例2: injectNewTransformer
import cpw.mods.fml.relauncher.IFMLLoadingPlugin; //导入依赖的package包/类
private void injectNewTransformer() throws ClassNotFoundException, NoSuchMethodException, NoSuchFieldException, IllegalAccessException, InvocationTargetException, InstantiationException {
Class e = Class.forName("cpw.mods.fml.relauncher.CoreModManager$FMLPluginWrapper");
Constructor wrapperConstructor = e.getConstructor(new Class[]{String.class, IFMLLoadingPlugin.class, File.class, Integer.TYPE, String[].class});
Field loadPlugins = CoreModManager.class.getDeclaredField("loadPlugins");
wrapperConstructor.setAccessible(true);
loadPlugins.setAccessible(true);
((List)loadPlugins.get((Object)null)).add(wrapperConstructor.newInstance(new Object[]{"CollectiveFrameworkPlugin", new CollectiveFrameworkTransformerPlugin(), null, Integer.valueOf(Integer.MAX_VALUE), new String[0]}));
didInject = true;
}
开发者ID:austinv11,项目名称:CollectiveFramework,代码行数:10,代码来源:CollectiveFrameworkEarlyTransformerPlugin.java