本文整理汇总了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;
}
}
示例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";
}
示例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();
}
示例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());
}
}
示例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);
}
示例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"), ','));
}
}
}
示例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"), ','));
}
}
}
示例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;
}
示例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());
}
}
示例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;
}
示例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();
}
示例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 = "";
}
示例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;
}
示例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();
}
示例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. ";
}