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


Java ModMetadata類代碼示例

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


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

示例1: detectOptifine

import net.minecraftforge.fml.common.ModMetadata; //導入依賴的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();
        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;
    }
}
 
開發者ID:F1r3w477,項目名稱:CustomWorldGen,代碼行數:25,代碼來源:FMLClientHandler.java

示例2: RezolveModContainer

import net.minecraftforge.fml.common.ModMetadata; //導入依賴的package包/類
public RezolveModContainer() {
	super(new ModMetadata());
	
	ModMetadata meta = getMetadata();
	
	meta.modId = "rezolvecore";
	meta.name = "RezolveCore";
	meta.version = "@[email protected]";
	meta.credits = "By William Lahti (rezonant)";
	meta.authorList = Arrays.asList(new String[] { "rezonant" });
	meta.description = "RezolveCore provides core modifications needed for Rezolve. Specifically, modifies EntityPlayer to allow the Remote Shell to override machine access restrictions related to the player's distance from the block.";
	meta.url = "https://minecraft.curseforge.com/projects/rezolve";
	meta.screenshots = new String[0];
	
	// I think it's a bummer that if you declare a parent, then the information is no longer browseable in the 
	// mods list. So I'm not declaring it.
	// meta.parent = "rezolve";
	meta.logoFile = "assets/rezolve/logo.png";
}
 
開發者ID:astronautlabs,項目名稱:rezolve,代碼行數:20,代碼來源:RezolveModContainer.java

示例3: preInit

import net.minecraftforge.fml.common.ModMetadata; //導入依賴的package包/類
@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();
	
}
 
開發者ID:ArtixAllMighty,項目名稱:ExSartagine,代碼行數:23,代碼來源:ExSartagine.java

示例4: setMissionControlPort

import net.minecraftforge.fml.common.ModMetadata; //導入依賴的package包/類
/** 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());
	}
}
 
開發者ID:Yarichi,項目名稱:Proyecto-DASI,代碼行數:20,代碼來源:AddressHelper.java

示例5: preInit

import net.minecraftforge.fml.common.ModMetadata; //導入依賴的package包/類
@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);
}
 
開發者ID:OCDiary,項目名稱:TheOink,代碼行數:18,代碼來源:TheOink.java

示例6: postInit

import net.minecraftforge.fml.common.ModMetadata; //導入依賴的package包/類
@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"), ','));
		}
	}
}
 
開發者ID:OreCruncher,項目名稱:DynamicSurroundings,代碼行數:17,代碼來源:DSurround.java

示例7: postInit

import net.minecraftforge.fml.common.ModMetadata; //導入依賴的package包/類
@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"), ','));
		}
	}
}
 
開發者ID:OreCruncher,項目名稱:DynamicSurroundings,代碼行數:18,代碼來源:Presets.java

示例8: getMetadata

import net.minecraftforge.fml.common.ModMetadata; //導入依賴的package包/類
@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;
}
 
開發者ID:SneakyTactician,項目名稱:BIGB,代碼行數:21,代碼來源:NEIModContainer.java

示例9: setMissionControlPort

import net.minecraftforge.fml.common.ModMetadata; //導入依賴的package包/類
/** 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());
	}
}
 
開發者ID:Microsoft,項目名稱:malmo,代碼行數:20,代碼來源:AddressHelper.java

示例10: injectData

import net.minecraftforge.fml.common.ModMetadata; //導入依賴的package包/類
/**
 * 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;
}
 
開發者ID:hockeyhurd,項目名稱:Project-Zed,代碼行數:22,代碼來源:ProjectZedMetadata.java

示例11: ModContainerHardModeTweaksCore

import net.minecraftforge.fml.common.ModMetadata; //導入依賴的package包/類
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();
}
 
開發者ID:hea3ven,項目名稱:HardModeTweaks,代碼行數:21,代碼來源:ModContainerHardModeTweaksCore.java

示例12: CamDummy

import net.minecraftforge.fml.common.ModMetadata; //導入依賴的package包/類
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 = "";
}
 
開發者ID:PorPit,項目名稱:MineCamera,代碼行數:14,代碼來源:CamDummy.java

示例13: setupMetadata

import net.minecraftforge.fml.common.ModMetadata; //導入依賴的package包/類
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;
}
 
開發者ID:PearXTeam,項目名稱:PurificatiMagicae,代碼行數:11,代碼來源:PurMag.java

示例14: preInit

import net.minecraftforge.fml.common.ModMetadata; //導入依賴的package包/類
@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();
}
 
開發者ID:bl4ckscor3,項目名稱:GlobalXP,代碼行數:24,代碼來源:GlobalXP.java

示例15: AuthlibLoginHelperModContainer

import net.minecraftforge.fml.common.ModMetadata; //導入依賴的package包/類
public AuthlibLoginHelperModContainer()
{
    super(new ModMetadata());
    ModMetadata modMetadata = this.getMetadata();
    modMetadata.modId = "authlibloginhelpercore";
    modMetadata.name = "AuthlibLoginHelperCore";
    modMetadata.version = "@[email protected]";
    modMetadata.authorList = Collections.singletonList("ustc_zzzz");
    modMetadata.description = "Inject a callback hook when connecting to server or LAN. ";
    modMetadata.credits = "Mojang AB, and the Forge and FML guys. ";
}
 
開發者ID:ustc-zzzz,項目名稱:AuthlibLoginHelper,代碼行數:12,代碼來源:AuthlibLoginHelperModContainer.java


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