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; } }
@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(); }
/** 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()); } }
@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); }
@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"), ',')); } } }
@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"), ',')); } } }
@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; }
/** 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()); } }
/** * 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; }
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(); }
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 = ""; }
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; }
@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(); }
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 = ""; }
/** * Return readed {@link ModMetadata} */ @Override public ModMetadata getModmeta() { ModMetadata modmeta = super.getModmeta(); modmeta.name = CoreLib.name; modmeta.version = CoreLib.version; return modmeta; }
public LibModContainer() { super(new ModMetadata()); ModMetadata meta = this.getMetadata(); meta.modId = "lib-helper"; meta.authorList.add("ci010"); meta.name = "Lib-helper"; this.startToHackScreen(); }
/** * 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"; }
@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); }
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(); } }
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; } } } }
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; }
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. "; }
@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); }
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 = ""; }
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); } }
@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"; }
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://..."; }
public ForgeMod() { super(new ModMetadata()); this.getMetadata().name = "NeptuneForge"; this.getMetadata().modId = "NeptuneForge"; initArno(); Canary.setServer((Server) FMLCommonHandler.instance().getMinecraftServerInstance()); }
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 = ""; }
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"; }
/** * 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(); }
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"; }