Java 类net.minecraftforge.fml.common.ModMetadata 实例源码

项目:CustomWorldGen    文件:FMLClientHandler.java   
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();
        InputStream optifineModInfoInputStream = getClass().getResourceAsStream("optifinemod.info");
        try
        {
            ModMetadata optifineMetadata = MetadataCollection.from(optifineModInfoInputStream, "optifine").getMetadataForId("optifine", dummyOptifineMeta);
            optifineContainer = new DummyModContainer(optifineMetadata);
            FMLLog.info("Forge Mod Loader has detected optifine %s, enabling compatibility features", optifineContainer.getVersion());
        }
        finally
        {
            IOUtils.closeQuietly(optifineModInfoInputStream);
        }
    }
    catch (Exception e)
    {
        optifineContainer = null;
    }
}
项目:ExSartagine    文件:ExSartagine.java   
@EventHandler
public void preInit(FMLPreInitializationEvent event){
    ModMetadata modMeta = event.getModMetadata();
    modMeta.authorList = Arrays.asList(new String[] { "Subaraki" });
    modMeta.autogenerated = false;
    modMeta.credits = "";
    modMeta.description = "Thermo Efficient Pots and Pans";
    modMeta.url = "https://github.com/ArtixAllMighty/ExSartagine/wiki";

    instance = this;

    ExSartagineBlock.load();
    ExSartagineItems.load();

    proxy.registerTileEntityAndRenderer();
    proxy.registerRenders();

    NetworkRegistry.INSTANCE.registerGuiHandler(instance, new GuiHandler());

    new Recipes();

}
项目:Proyecto-DASI    文件:AddressHelper.java   
/** Set the actual port used for mission control - not persisted, could be different each time the Mod is run.
 * @param port the port currently in use for mission control.
 */
static public void setMissionControlPort(int port)
{
    if (port != AddressHelper.missionControlPort)
    {
        AddressHelper.missionControlPort = port;
        // Also update our metadata, for displaying to the user:
        ModMetadata md = Loader.instance().activeModContainer().getMetadata();
        if (port != -1)
            md.description = "Talk to this Mod using port " + EnumChatFormatting.GREEN + port;
        else
            md.description = EnumChatFormatting.RED + "ERROR: No mission control port - check configuration";

        // See if changing the port should lead to changing the login details:
        //AuthenticationHelper.update(MalmoMod.instance.getModPermanentConfigFile());
    }
}
项目:TheOink    文件:TheOink.java   
@Mod.EventHandler
public void preInit(FMLPreInitializationEvent event) {
    System.out.println(NAME + "now loading...");
    /**
     This is now going to go into generating a mcmod.info file
     **/
    ModMetadata data = event.getModMetadata();
    data.autogenerated = false;
    data.modId = MODID;
    data.version = VERSION;
    data.authorList.add("OCDiary, Alex_Couch");
    data.credits = CREDITS;
    data.description = DESCRIPTION;
    data.name = NAME;
    data.logoFile = LOGO;
    proxy.preInit(event);
}
项目:DynamicSurroundings    文件:DSurround.java   
@EventHandler
public void postInit(@Nonnull final FMLPostInitializationEvent event) {
    proxy.postInit(event);
    config.save();

    // Patch up metadata
    if (!proxy.isRunningAsServer()) {
        final ModMetadata data = ForgeUtils.getModMetadata(DSurround.MOD_ID);
        if (data != null) {
            data.name = Localization.format("dsurround.metadata.Name");
            data.credits = Localization.format("dsurround.metadata.Credits");
            data.description = Localization.format("dsurround.metadata.Description");
            data.authorList = Arrays.asList(StringUtils.split(Localization.format("dsurround.metadata.Authors"), ','));
        }
    }
}
项目:DynamicSurroundings    文件:Presets.java   
@EventHandler
public void postInit(@Nonnull final FMLPostInitializationEvent event) {
    proxy.postInit(event);
    config.save();

    // Patch up metadata
    if (!proxy.isRunningAsServer()) {
        final ModMetadata data = ForgeUtils.getModMetadata(Presets.MOD_ID);
        if (data != null) {
            data.name = Localization.format("presets.metadata.Name");
            data.credits = Localization.format("presets.metadata.Credits");
            data.description = Localization.format("presets.metadata.Description");
            data.authorList = Arrays
                    .asList(StringUtils.split(Localization.format("presets.metadata.Authors"), ','));
        }
    }
}
项目:BIGB    文件:NEIModContainer.java   
@Override
public ModMetadata getMetadata() {
    String s_plugins = "";
    if (plugins.size() == 0) {
        s_plugins += EnumChatFormatting.RED+"No installed plugins.";
    } else {
        s_plugins += EnumChatFormatting.GREEN+"Installed plugins: ";
        for (int i = 0; i < plugins.size(); i++) {
            if (i > 0)
                s_plugins += ", ";
            IConfigureNEI plugin = plugins.get(i);
            s_plugins += plugin.getName() + " " + plugin.getVersion();
        }
        s_plugins += ".";
    }

    ModMetadata meta = super.getMetadata();
    meta.description = description.replace("<plugins>", s_plugins);
    return meta;
}
项目:malmo    文件:AddressHelper.java   
/** Set the actual port used for mission control - not persisted, could be different each time the Mod is run.
 * @param port the port currently in use for mission control.
 */
static public void setMissionControlPort(int port)
{
    if (port != AddressHelper.missionControlPort)
    {
        AddressHelper.missionControlPort = port;
        // Also update our metadata, for displaying to the user:
        ModMetadata md = Loader.instance().activeModContainer().getMetadata();
        if (port != -1)
            md.description = "Talk to this Mod using port " + TextFormatting.GREEN + port;
        else
            md.description = TextFormatting.RED + "ERROR: No mission control port - check configuration";

        // See if changing the port should lead to changing the login details:
        //AuthenticationHelper.update(MalmoMod.instance.getModPermanentConfigFile());
    }
}
项目:Project-Zed    文件:ProjectZedMetadata.java   
/**
 * Attemps to inject data into mcmod.info such that it is correct and remains 'up to date'.
 *
 * @param metadata
 */
private void injectData(final ModMetadata metadata) {
    metadata.autogenerated = false;

    if (!metadata.authorList.isEmpty()) metadata.authorList.set(0, "hockeyhurd");
    else metadata.authorList.add("hockeyhurd");

    metadata.credits = "hockeyhurd";
    metadata.modId = Reference.MOD_NAME;
    metadata.version = Reference.VERSION;
    metadata.name = Reference.MOD_NAME;
    metadata.url = "http://goo.gl/nYTUfU";
    metadata.logoFile = "";
    metadata.description = "A tech mod set to be unique and progressive.";

    result = true;
}
项目:HardModeTweaks    文件:ModContainerHardModeTweaksCore.java   
public ModContainerHardModeTweaksCore() {
    super(new ModMetadata());

    logger.debug("configuring the mod");

    ModMetadata meta = getMetadata();
    meta.modId = "hardmodetweakscore";
    meta.name = "Hard Mode Tweaks Core";
    meta.version = "1.0.0";
    meta.authorList = Lists.newArrayList("Hea3veN");
    meta.description = "Core mod for Hard Mode Tweaks";
    meta.url = "https://github.com/hea3ven/HardModeTweaks";
    meta.screenshots = new String[0];
    // meta.logoFile = "/hmt_logo.png";
    meta.parent = "hardmodetweaks";

    meta.requiredMods = Sets.newHashSet();
    meta.dependencies = Lists.newArrayList();
    meta.dependants = Lists.newArrayList();
}
项目:MineCamera    文件:CamDummy.java   
public CamDummy() {
    super(new ModMetadata());
    ModMetadata meta = getMetadata();
    meta.modId = modid;
    meta.name = "MineCameraDummy";
    meta.version = version;
    meta.credits = "none";
    meta.authorList.add("none");
    meta.description = "";
    meta.url = "";
    meta.screenshots = new String[0];
    meta.logoFile = "";
}
项目:PurificatiMagicae    文件:PurMag.java   
private void setupMetadata(ModMetadata data)
{
    data.autogenerated = false;
    data.credits = "afdw & Prototik - cool guys";
    data.authorList = Arrays.asList("mrAppleXZ", "DrVexsear", "gt22");
    data.description = "Purificati Magicae";
    data.modId = PurMag.MODID;
    data.name = PurMag.NAME;
    data.version = PurMag.VERSION;
}
项目:Proyecto-DASI    文件:AddressHelper.java   
/** Set the actual port used for mission control - not persisted, could be different each time the Mod is run.
 * @param port the port currently in use for mission control.
 */
static public void setMissionControlPort(int port)
{
    if (port != AddressHelper.missionControlPort)
    {
        AddressHelper.missionControlPort = port;
        // Also update our metadata, for displaying to the user:
        ModMetadata md = Loader.instance().activeModContainer().getMetadata();
        if (port != -1)
            md.description = "Talk to this Mod using port " + EnumChatFormatting.GREEN + port;
        else
            md.description = EnumChatFormatting.RED + "ERROR: No mission control port - check configuration";

        // See if changing the port should lead to changing the login details:
        //AuthenticationHelper.update(MalmoMod.instance.getModPermanentConfigFile());
    }
}
项目:GlobalXP    文件:GlobalXP.java   
@EventHandler
public void preInit(FMLPreInitializationEvent event)
{
    ModMetadata meta = event.getModMetadata();

    meta.authorList = Arrays.asList(new String[]{"bl4ckscor3"});
    meta.autogenerated = false;
    meta.description = "Adds a fast way to store XP and share it with your friends!";
    meta.modId = MOD_ID;
    meta.name = NAME;
    meta.version = VERSION;
    MinecraftForge.EVENT_BUS.register(new bl4ckscor3.mod.globalxp.handlers.EventHandler());
    config = new Config(event.getSuggestedConfigurationFile());
    network = NetworkRegistry.INSTANCE.newSimpleChannel(MOD_ID);
    network.registerMessage(new SPacketUpdateXPBlock.Handler(), SPacketUpdateXPBlock.class, 0, Side.CLIENT);
    network.registerMessage(new CPacketRequestXPBlockUpdate.Handler(), CPacketRequestXPBlockUpdate.class, 1, Side.SERVER);
    xp_block = new XPBlock(Material.IRON);
    GameData.register_impl(xp_block);
    GameData.register_impl(new ItemBlock(xp_block).setRegistryName(xp_block.getRegistryName().toString()));
    GameRegistry.registerTileEntity(TileEntityXPBlock.class, xp_block.getRegistryName().toString());
    serverProxy.loadModels();
    serverProxy.registerRenderers();
}
项目:BetterFonts    文件:BFDummyContainer.java   
public BFDummyContainer()
{
    super(new ModMetadata());
    ModMetadata meta = getMetadata();
    meta.modId = "betterfonts";
    meta.name = "BetterFonts";
    meta.version = "1.9.1";
    meta.credits = "thvortex for original codes, iSuzutsuki";
    meta.authorList = Arrays.asList("CubeX2");
    meta.description = "OpenType font support for Minecraft";
    meta.url = "http://minecraft.curseforge.com/projects/truetype-font-replacement";
    meta.screenshots = new String[0];
    meta.logoFile = "";
}
项目:ModLibary    文件:ModMetadataFetcherCoreLib.java   
/**
 * Return readed {@link ModMetadata}
 */
@Override
public ModMetadata getModmeta() {
    ModMetadata modmeta = super.getModmeta();
    modmeta.name = CoreLib.name;
    modmeta.version = CoreLib.version;
    return modmeta;
}
项目:InspiringWorld    文件:LibModContainer.java   
public LibModContainer()
{
    super(new ModMetadata());
    ModMetadata meta = this.getMetadata();
    meta.modId = "lib-helper";
    meta.authorList.add("ci010");
    meta.name = "Lib-helper";
    this.startToHackScreen();
}
项目:MinecraftForge-BotAPI    文件:BotAPI.java   
/**
 * This is the constructor of the Mod Object.
 * It sets the Mod's Metadata.
 * @see ModMetadata
 */
public BotAPI()
{
    super(new ModMetadata());
    ModMetadata md = getMetadata();
    md.autogenerated = false;
    md.version = VERSION;
    md.modId = MODID;
    md.authorList.add("Jaideep Singh Heer");
    md.description = "A Mod create and control bots for automation.";
    md.credits = "Made by the Jaideep Singh Heer.";
    md.name = "BotAPI Mod";
}
项目:EnderStorage    文件:EnderStorage.java   
@Mod.EventHandler
public void preInit(FMLPreInitializationEvent event) {
    ConfigurationHandler.init(event.getSuggestedConfigurationFile());
    proxy.preInit();
    ModMetadata metadata = event.getModMetadata();
    metadata.description = modifyDesc(metadata.description);
    ModDescriptionEnhancer.registerEnhancement(MOD_ID, MOD_NAME);
}
项目:TextureDump    文件:ModStatsDumper.java   
private ModMetadata getModMetadata(String resourceDomain) {
    ModContainer modContainer = modContainersForLowercaseIds.get(resourceDomain.toLowerCase(Locale.ENGLISH));
    if (modContainer == null) {
        ModMetadata modMetadata = new ModMetadata();
        modMetadata.name = resourceDomain.equals("minecraft") ? "Minecraft" : "unknown";
        return modMetadata;
    } else {
        return modContainer.getMetadata();
    }
}
项目:CodeChickenLib    文件:ModDescriptionEnhancer.java   
private static void applySupporters() {
    for (Entry<String, List<String>> entry : supporters.entrySet()) {
        if (mods.containsKey(entry.getKey())) {
            ModMetadata metadata = mods.get(entry.getKey());
            String supporters_string = generateList(entry.getValue());
            if (metadata.description.contains("<supporters>")) {
                metadata.description = metadata.description.replace("<supporters>", supporters_string);
            } else {
                metadata.description = metadata.description + supporters_string;
            }
        }
    }
}
项目:Alchemy    文件:AlchemyDLCLoader.java   
public DLCContainer(IDLCInfo info) {
    super(new ModMetadata());
    ModMetadata metadata = getMetadata();
    metadata.modId = MOD_ID + "_dlc_" + info.name();
    metadata.name = MOD_NAME + " DLC " + info.name();
    metadata.version = info.version();
    metadata.description = info.description();
    metadata.parent = MOD_ID;
    this.info = info;
}
项目:Alchemy    文件:AlchemyModContainer.java   
public AlchemyModContainer(ModMetadata metadata) {
    super(metadata);
    metadata.modId = CORE_MOD_ID;
    metadata.name = CORE_MOD_NAME;
    metadata.version = CORE_MOD_VERSION;
    metadata.authorList = Arrays.asList(AUTHORLIST);
    metadata.description = "Alchemy mod core, as the pre-loading mod.";
    metadata.credits = "Mojang AB, and the Forge and FML guys. ";
}
项目:ChickenChunks    文件:ChickenChunks.java   
@Mod.EventHandler
public void preInit(FMLPreInitializationEvent event) {
    config = new ConfigFile(new File(event.getModConfigurationDirectory(), "ChickenChunks.cfg")).setComment("ChunkLoader Configuration File\nDeleting any element will restore it to it's default value");
    proxy.preInit();
    ModMetadata metadata = event.getModMetadata();
    metadata.description = modifyDesc(metadata.description);
    ModDescriptionEnhancer.registerEnhancement(MOD_ID, MOD_NAME);
}
项目:TFC2    文件:TFC2Core.java   
public TFC2Core()
{
    super(new ModMetadata());
    ModMetadata meta = getMetadata();
    meta.modId = "tfc2_coremod";
    meta.name = "TFC2[coremod]";
    meta.version = Reference.ModVersion;
    meta.credits = "";
    meta.authorList = Arrays.asList("Bioxx");
    meta.description = "";
    meta.url = "www.terrafirmacraft.com";
    meta.updateUrl = "";
    meta.screenshots = new String[0];
    meta.logoFile = "";
}
项目:FastAsyncWorldedit    文件:FaweForge.java   
public FaweForge(ForgeMain plugin, Logger logger, ModMetadata mod, File directory) {
    this.parent = plugin;
    this.logger = logger;
    this.directory = directory;
    this.mod = mod;
    try {
        Fawe.set(this);
        setupInjector();
    } catch (InstanceAlreadyExistsException e) {
        MainUtil.handleError(e);
    }
}
项目:FastAsyncWorldedit    文件:FaweForge.java   
public FaweForge(ForgeMain plugin, Logger logger, ModMetadata mod, File directory) {
    this.parent = plugin;
    this.logger = logger;
    this.directory = directory;
    this.mod = mod;
    try {
        Fawe.set(this);
        setupInjector();
    } catch (InstanceAlreadyExistsException e) {
        MainUtil.handleError(e);
    }
}
项目:FastAsyncWorldedit    文件:FaweForge.java   
public FaweForge(ForgeMain plugin, Logger logger, ModMetadata mod, File directory) {
    this.parent = plugin;
    this.logger = logger;
    this.directory = directory;
    this.mod = mod;
    try {
        Fawe.set(this);
        setupInjector();
    } catch (InstanceAlreadyExistsException e) {
        MainUtil.handleError(e);
    }
}
项目:FastAsyncWorldedit    文件:FaweForge.java   
public FaweForge(ForgeMain plugin, Logger logger, ModMetadata mod, File directory) {
    this.parent = plugin;
    this.logger = logger;
    this.directory = directory;
    this.mod = mod;
    try {
        Fawe.set(this);
        setupInjector();
    } catch (InstanceAlreadyExistsException e) {
        MainUtil.handleError(e);
    }
}
项目:FastAsyncWorldedit    文件:FaweForge.java   
public FaweForge(ForgeMain plugin, Logger logger, ModMetadata mod, File directory) {
    this.parent = plugin;
    this.logger = logger;
    this.directory = directory;
    this.mod = mod;
    try {
        Fawe.set(this);
        setupInjector();
    } catch (InstanceAlreadyExistsException e) {
        MainUtil.handleError(e);
    }
}
项目:AllPI    文件:AllPI.java   
@EventHandler
  public void preInit(FMLPreInitializationEvent event) {
    network = NetworkRegistry.INSTANCE.newSimpleChannel(Reference.MODID);
configHandler.setupAPIPackets(network);

      ModMetadata modMeta = event.getModMetadata();
      modMeta.authorList = Arrays.asList(new String[] {
          "Geforce"
      });
      modMeta.autogenerated = false;
      modMeta.credits = "";
      modMeta.description = "AllPI is a open-source modding library designed to provide multiple APIs at once. You're welcome to contribute to it!";
      modMeta.url = "http://github.com/Geforce132/AllPI";

  }
项目:SasaLib    文件:SasaLibAsmCore.java   
public SasaLibAsmCore()
{
    super(new ModMetadata());

    ModMetadata meta = super.getMetadata();
    meta.modId = "sasaLibAsm";
    meta.name = "Sasa Lib Asm Core";
    meta.version = "1.0";
    meta.authorList = Arrays.asList(new String[]{"Noto"});
    //meta.description = "A tutorial access transformer mod.";
    //meta.url = "http://...";
}
项目:NeptuneForge    文件:ForgeMod.java   
public ForgeMod() {
    super(new ModMetadata());
    this.getMetadata().name = "NeptuneForge";
    this.getMetadata().modId = "NeptuneForge";

    initArno();
    Canary.setServer((Server) FMLCommonHandler.instance().getMinecraftServerInstance());
}
项目:Additional-Resources    文件:Ar_ModContainer.java   
public Ar_ModContainer() {
    super(new ModMetadata());
    ModMetadata metadata = getMetadata();
    metadata.modId = "additionalresources";
    metadata.name = "Additional Resources";
    metadata.version = "0.1.1";
    metadata.authorList = Arrays.asList("Portablejim");
    metadata.description = "Load loose files as additional resources";
    metadata.url= "";
    metadata.updateUrl = "";
    metadata.screenshots = new String[0];
    metadata.logoFile = "";
}
项目:TFC2    文件:TFC2Core.java   
public TFC2Core()
{
    super(new ModMetadata());
    ModMetadata meta = getMetadata();
    meta.modId = "tfc2_coremod";
    meta.name = "TFC2[coremod]";
    meta.version = Reference.ModVersion;
    meta.credits = "";
    meta.authorList = Arrays.asList("Bioxx");
    meta.description = "";
    meta.url = "www.terrafirmacraft.com";
    meta.updateUrl = "";
    meta.screenshots = new String[0];
    meta.logoFile = "";
}
项目:IvToolkit    文件:IvToolkitCoreContainer.java   
public IvToolkitCoreContainer()
{
    super(new ModMetadata());

    ModMetadata myMeta = super.getMetadata();
    myMeta.authorList = Collections.singletonList("Ivorius");
    myMeta.description = "Uncategorized framework";
    myMeta.modId = IvToolkit.MODID;
    myMeta.version = IvToolkit.VERSION;
    myMeta.name = IvToolkit.NAME;
    myMeta.url = "http://www.minecraftforum.net/topic/563257-172";
}
项目:CazzarCoreLib    文件:ModContainer.java   
/**
 * Initialize the mod
 */
public ModContainer() {
    super(meta = new ModMetadata());

    meta.authorList = Arrays.asList("cazzar");
    meta.description = "The core library for cazzar's mods";
    meta.modId = Reference.MOD_ID;
    meta.name = "Cazzar Core Lib";
    meta.dependants = Arrays.asList((ArtifactVersion) new DefaultArtifactVersion("jukeboxreloaded", true));
    meta.url = "http://www.cazzar.net/";
    meta.version = getVersionFromJar();
}
项目:sprinkles_for_vanilla    文件:MetadataHelper.java   
public static void transformMetadata(ModMetadata meta)
{
    meta.authorList.clear();
    meta.authorList.add("VikeStep");
    meta.modId = ModInfo.MOD_ID;
    meta.name = ModInfo.MOD_NAME;
    meta.description = "This mod adds a config file for vanilla";
    meta.version = ModInfo.VERSION;
    meta.url = "http://minecraft.curseforge.com/mc-mods/226309-sprinkles_for_vanilla";
    meta.credits = "VikeStep and squeek502 for his ASMHelper";
}