當前位置: 首頁>>代碼示例>>Java>>正文


Java DummyModContainer類代碼示例

本文整理匯總了Java中cpw.mods.fml.common.DummyModContainer的典型用法代碼示例。如果您正苦於以下問題:Java DummyModContainer類的具體用法?Java DummyModContainer怎麽用?Java DummyModContainer使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


DummyModContainer類屬於cpw.mods.fml.common包,在下文中一共展示了DummyModContainer類的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: detectOptifine

import cpw.mods.fml.common.DummyModContainer; //導入依賴的package包/類
private void detectOptifine()
{
    try
    {
        Class<?> optifineConfig = Class.forName("Config", false, Loader.instance().getModClassLoader());
        String optifineVersion = (String) optifineConfig.getField("VERSION").get(null);
        Map<String,Object> dummyOptifineMeta = ImmutableMap.<String,Object>builder().put("name", "Optifine").put("version", optifineVersion).build();
        ModMetadata optifineMetadata = MetadataCollection.from(getClass().getResourceAsStream("optifinemod.info"),"optifine").getMetadataForId("optifine", dummyOptifineMeta);
        optifineContainer = new DummyModContainer(optifineMetadata);
        FMLLog.info("Forge Mod Loader has detected optifine %s, enabling compatibility features",optifineContainer.getVersion());
    }
    catch (Exception e)
    {
        optifineContainer = null;
    }
}
 
開發者ID:SchrodingersSpy,項目名稱:TRHS_Club_Mod_2016,代碼行數:17,代碼來源:FMLClientHandler.java

示例2: doLoadOrderHaxing

import cpw.mods.fml.common.DummyModContainer; //導入依賴的package包/類
/**
 * We must force the following load order, otherwise many things break:
 *  - TFC
 *  - This mod
 *  - Anything else
 */
public static void doLoadOrderHaxing()
{
    File injectedDepFile = new File(Loader.instance().getConfigDir(), "injectedDependencies.json");

    JsonArray deps = new JsonArray();
    JsonObject dep = new JsonObject();
    dep.addProperty("type", "after");
    dep.addProperty("target", TFC);
    deps.add(dep);

    for (ModContainer container : Loader.instance().getModList())
    {
        if (container instanceof DummyModContainer || container instanceof InjectedModContainer) continue;
        String modid = container.getModId();
        if (modid.equals(MODID) || modid.equals(TFC)) continue;
        dep = new JsonObject();
        dep.addProperty("type", "before");
        dep.addProperty("target", modid);
        deps.add(dep);
    }

    JsonArray root = new JsonArray();
    JsonObject mod = new JsonObject();
    mod.addProperty("modId", MODID);
    mod.add("deps", deps);
    root.add(mod);

    try
    {
        FileUtils.write(injectedDepFile, GSON.toJson(root));
    }
    catch (IOException e)
    {
        throw new RuntimeException(e);
    }
}
 
開發者ID:dries007,項目名稱:TFC-Tweaks,代碼行數:43,代碼來源:Helper.java

示例3: EAPluginContainer

import cpw.mods.fml.common.DummyModContainer; //導入依賴的package包/類
public EAPluginContainer(File file)
{
	ModMetadata stub = new ModMetadata();
	stub.modId = file.getName().toLowerCase();
	stub.name = file.getName();
	stub.version = "eaLua Compatible Plugin 1.0";
	this.container = (ModContainer)new DummyModContainer(stub);
}
 
開發者ID:Cephrus,項目名稱:Elite-Armageddon,代碼行數:9,代碼來源:EAPluginContainer.java

示例4: start

import cpw.mods.fml.common.DummyModContainer; //導入依賴的package包/類
public static void start(File coremodLocation) {
    LoadingFrame.setSystemLAF();
    coreModLocation = coremodLocation;
    if (coreModLocation == null)
        coreModLocation = new File("./../bin/");
    // Assume this is a dev environment, and that the build dir is in bin, and the test dir has the same parent as
    // the bin dir...
    ModMetadata md = new ModMetadata();
    md.name = Lib.Mod.NAME;
    md.modId = Lib.Mod.ID;
    modContainer = new DummyModContainer(md) {
        @Override
        public Class<?> getCustomResourcePackClass() {
            return FMLFileResourcePack.class;
        }

        @Override
        public File getSource() {
            return coreModLocation;
        }

        @Override
        public String getModId() {
            return Lib.Mod.ID;
        }
    };

    File fileOld = new File("./config/betterloadingscreen.cfg");
    File fileNew = new File("./config/BetterLoadingScreen/config.cfg");

    if (fileOld.exists())
        cfg = new Configuration(fileOld);
    else
        cfg = new Configuration(fileNew);

    boolean useMinecraft = isClient();
    if (useMinecraft) {
        String comment =
                "Whether or not to use minecraft's display to show the progress. This looks better, but there is a possibilty of not being ";
        comment += "compatible, so if you do have any strange crash reports or compatability issues, try setting this to false";
        useMinecraft = cfg.getBoolean("useMinecraft", "general", true, comment);
    }

    connectExternally = cfg.getBoolean("connectExternally", "general", true, "If this is true, it will conect to drone.io to get a changelog");

    playSound = cfg.getBoolean("playSound", "general", true, "Play a sound after minecraft has finished starting up");

    if (useMinecraft)
        displayer = new MinecraftDisplayerWrapper();
    else if (!GraphicsEnvironment.isHeadless())
        displayer = new FrameDisplayer();
    else
        displayer = new LoggingDisplayer();
    displayer.open(cfg);
    cfg.save();
}
 
開發者ID:AlexIIL,項目名稱:BetterLoadingScreen_1.7,代碼行數:57,代碼來源:ProgressDisplayer.java


注:本文中的cpw.mods.fml.common.DummyModContainer類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。