本文整理汇总了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);
}
}
示例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();
}
}
}
示例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();
}
示例4: mcVersion
import net.minecraftforge.fml.relauncher.FMLInjectionData; //导入依赖的package包/类
public static String mcVersion() {
return (String) FMLInjectionData.data()[4];
}
示例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");
}
}
示例6: getMinecraftDir
import net.minecraftforge.fml.relauncher.FMLInjectionData; //导入依赖的package包/类
public static File getMinecraftDir() {
return (File) FMLInjectionData.data()[6];
}
示例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");
}
示例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");
}
示例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");
}