当前位置: 首页>>代码示例>>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;未经允许,请勿转载。