当前位置: 首页>>代码示例>>Java>>正文


Java FMLInjectionData类代码示例

本文整理汇总了Java中net.minecraftforge.fml.relauncher.FMLInjectionData的典型用法代码示例。如果您正苦于以下问题:Java FMLInjectionData类的具体用法?Java FMLInjectionData怎么用?Java FMLInjectionData使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


FMLInjectionData类属于net.minecraftforge.fml.relauncher包,在下文中一共展示了FMLInjectionData类的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: injectIntoClassLoader

import net.minecraftforge.fml.relauncher.FMLInjectionData; //导入依赖的package包/类
@Override
public void injectIntoClassLoader(LaunchClassLoader classLoader)
{
    // Deobfuscation transformer, always last, and the access transformer tweaker as well
    classLoader.registerTransformer("net.minecraftforge.fml.common.asm.transformers.DeobfuscationTransformer");
    // Add all the access transformers now as well
    for (String transformer : CoreModManager.getAccessTransformers())
    {
        classLoader.registerTransformer(transformer);
    }
    classLoader.registerTransformer("net.minecraftforge.fml.common.asm.transformers.ModAccessTransformer");
    classLoader.registerTransformer("net.minecraftforge.fml.common.asm.transformers.ItemStackTransformer");
    try
    {
        FMLRelaunchLog.fine("Validating minecraft");
        Class<?> loaderClazz = Class.forName("net.minecraftforge.fml.common.Loader", true, classLoader);
        Method m = loaderClazz.getMethod("injectData", Object[].class);
        m.invoke(null, (Object)FMLInjectionData.data());
        m = loaderClazz.getMethod("instance");
        m.invoke(null);
        FMLRelaunchLog.fine("Minecraft validated, launching...");
    }
    catch (Exception e)
    {
        // Load in the Loader, make sure he's ready to roll - this will initialize most of the rest of minecraft here
        System.out.println("A CRITICAL PROBLEM OCCURRED INITIALIZING MINECRAFT - LIKELY YOU HAVE AN INCORRECT VERSION FOR THIS FML");
        throw new RuntimeException(e);
    }
}
 
开发者ID:F1r3w477,项目名称:CustomWorldGen,代码行数:30,代码来源:FMLDeobfTweaker.java

示例2: runConfiguration

import net.minecraftforge.fml.relauncher.FMLInjectionData; //导入依赖的package包/类
/**
 * Create a configuration file for the file given in parameter with the provided config version number.
 */
private void runConfiguration(File file, String configVersion)
{
    this.file = file;
    this.definedConfigVersion = configVersion;
    String basePath = ((File)(FMLInjectionData.data()[6])).getAbsolutePath().replace(File.separatorChar, '/').replace("/.", "");
    String path = file.getAbsolutePath().replace(File.separatorChar, '/').replace("/./", "/").replace(basePath, "");
    if (PARENT != null)
    {
        PARENT.setChild(path, this);
        isChild = true;
    }
    else
    {
        fileName = path;
        try
        {
            load();
        }
        catch (Throwable e)
        {
            File fileBak = new File(file.getAbsolutePath() + "_" +
                    new SimpleDateFormat("yyyyMMdd_HHmmss").format(new Date()) + ".errored");
            FMLLog.severe("An exception occurred while loading config file %s. This file will be renamed to %s " +
                    "and a new config file will be generated.", file.getName(), fileBak.getName());
            e.printStackTrace();

            file.renameTo(fileBak);
            load();
        }
    }
}
 
开发者ID:F1r3w477,项目名称:CustomWorldGen,代码行数:35,代码来源:Configuration.java

示例3: CodeChickenCorePlugin

import net.minecraftforge.fml.relauncher.FMLInjectionData; //导入依赖的package包/类
public CodeChickenCorePlugin() {
    if (minecraftDir != null) {
        return;//get called twice, once for IFMLCallHook
    }

    minecraftDir = (File) FMLInjectionData.data()[6];
    currentMcVersion = (String) FMLInjectionData.data()[4];

    loadConfig();
}
 
开发者ID:TheCBProject,项目名称:CodeChickenCore,代码行数:11,代码来源:CodeChickenCorePlugin.java

示例4: mcVersion

import net.minecraftforge.fml.relauncher.FMLInjectionData; //导入依赖的package包/类
public static String mcVersion() {
    return (String) FMLInjectionData.data()[4];
}
 
开发者ID:TheCBProject,项目名称:CodeChickenCore,代码行数:4,代码来源:CCUpdateChecker.java

示例5: initConfig

import net.minecraftforge.fml.relauncher.FMLInjectionData; //导入依赖的package包/类
public static void initConfig() {
    if (configFile == null) {
        configFile = new ConfigFile(new File((File) FMLInjectionData.data()[6], "config/CodeChickenTweaks.cfg")).setComment("CodeChickenTweaks configuration file.\n" + "Deleting any element will restore it to it's default value");
    }
}
 
开发者ID:TheCBProject,项目名称:CCTweaks,代码行数:6,代码来源:CCTweaks.java

示例6: getMinecraftDir

import net.minecraftforge.fml.relauncher.FMLInjectionData; //导入依赖的package包/类
public static File getMinecraftDir() {
    return (File) FMLInjectionData.data()[6];
}
 
开发者ID:TheCBProject,项目名称:CodeChickenLib,代码行数:4,代码来源:CommonUtils.java

示例7: Importer

import net.minecraftforge.fml.relauncher.FMLInjectionData; //导入依赖的package包/类
public Importer(GuiLoader screen, String name) {
	this.screen = screen;
	File mcDir = (File) FMLInjectionData.data()[6];
	folder = new File(mcDir, "guis");
	file = new File(folder, name + ".gui");
}
 
开发者ID:modmuss50,项目名称:Gui_Desiner,代码行数:7,代码来源:GuiLoader.java

示例8: Saver

import net.minecraftforge.fml.relauncher.FMLInjectionData; //导入依赖的package包/类
public Saver(GuiDesigner guiDesigner, String name) {
    this.guiDesigner = guiDesigner;
    File mcDir = (File) FMLInjectionData.data()[6];
    folder = new File(mcDir, "guis");
    file = new File(folder, name + ".gui");
}
 
开发者ID:modmuss50,项目名称:Gui_Desiner,代码行数:7,代码来源:Saver.java

示例9: Loader

import net.minecraftforge.fml.relauncher.FMLInjectionData; //导入依赖的package包/类
public Loader(String name) {
    File mcDir = (File) FMLInjectionData.data()[6];
    folder = new File(mcDir, "guis");
    file = new File(folder, name + ".gui");
}
 
开发者ID:modmuss50,项目名称:Gui_Desiner,代码行数:6,代码来源:Loader.java


注:本文中的net.minecraftforge.fml.relauncher.FMLInjectionData类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。