net.minecraftforge.fml.relauncher.IFMLLoadingPlugin Java Examples

The following examples show how to use net.minecraftforge.fml.relauncher.IFMLLoadingPlugin. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: CodeChickenCorePlugin.java    From CodeChickenCore with MIT License 5 votes vote down vote up
private void injectDeobfPlugin() {
    try {
        Class<?> wrapperClass = Class.forName("net.minecraftforge.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);
    }
}