本文整理汇总了Java中net.minecraftforge.fml.common.event.FMLPreInitializationEvent.getModMetadata方法的典型用法代码示例。如果您正苦于以下问题:Java FMLPreInitializationEvent.getModMetadata方法的具体用法?Java FMLPreInitializationEvent.getModMetadata怎么用?Java FMLPreInitializationEvent.getModMetadata使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类net.minecraftforge.fml.common.event.FMLPreInitializationEvent
的用法示例。
在下文中一共展示了FMLPreInitializationEvent.getModMetadata方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: preInit
import net.minecraftforge.fml.common.event.FMLPreInitializationEvent; //导入方法依赖的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();
}
示例2: preInit
import net.minecraftforge.fml.common.event.FMLPreInitializationEvent; //导入方法依赖的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);
}
示例3: preInit
import net.minecraftforge.fml.common.event.FMLPreInitializationEvent; //导入方法依赖的package包/类
@EventHandler
public void preInit(FMLPreInitializationEvent event)
{
if (!SchemaHelper.testSchemaVersionNumbers(Loader.instance().activeModContainer().getVersion()))
throw new RuntimeException("This mod has been incorrectly built; check schema version numbers.");
if (event.getModMetadata().version.equals("${version}"))
{
// The mcmod.info version number is populated by gradle; if we've been built without gradle,
// via eclipse say, then we can just use the internal version number instead, which comes to us from the version.properties file.
// (There's no real benefit to doing this; it just looks nicer in the Mod GUI if the version number is filled in.)
event.getModMetadata().version = Loader.instance().activeModContainer().getVersion();
}
// Load the correct configs (client or server)
File configDir = event.getModConfigurationDirectory();
File sessionConfigFile = new File(configDir, MODID + event.getSide().toString() + ".cfg");
File permanentConfigFile = new File(configDir, MODID + event.getSide().toString() + "Permanent.cfg");
this.sessionConfig = new Configuration(sessionConfigFile);
this.sessionConfig.load();
this.permanentConfig = new Configuration(permanentConfigFile);
this.permanentConfig.load();
AddressHelper.update(this.sessionConfig);
ScreenHelper.update(this.permanentConfig);
network = NetworkRegistry.INSTANCE.newSimpleChannel("Malmo");
network.registerMessage(ObservationFromFullStatsImplementation.FullStatsRequestMessageHandler.class, ObservationFromFullStatsImplementation.FullStatsRequestMessage.class, 1, Side.SERVER);
network.registerMessage(ObservationFromGridImplementation.GridRequestMessageHandler.class, ObservationFromGridImplementation.GridRequestMessage.class, 2, Side.SERVER);
network.registerMessage(MalmoMessageHandler.class, MalmoMessage.class, 3, Side.CLIENT); // Malmo messages from server to client
network.registerMessage(SimpleCraftCommandsImplementation.CraftMessageHandler.class, SimpleCraftCommandsImplementation.CraftMessage.class, 4, Side.SERVER);
network.registerMessage(AbsoluteMovementCommandsImplementation.TeleportMessageHandler.class, AbsoluteMovementCommandsImplementation.TeleportMessage.class, 5, Side.SERVER);
network.registerMessage(MalmoMessageHandler.class, MalmoMessage.class, 6, Side.SERVER); // Malmo messages from client to server
network.registerMessage(InventoryCommandsImplementation.InventoryMessageHandler.class, InventoryCommandsImplementation.InventoryMessage.class, 7, Side.SERVER);
network.registerMessage(DiscreteMovementCommandsImplementation.UseActionMessageHandler.class, DiscreteMovementCommandsImplementation.UseActionMessage.class, 8, Side.SERVER);
network.registerMessage(DiscreteMovementCommandsImplementation.AttackActionMessageHandler.class, DiscreteMovementCommandsImplementation.AttackActionMessage.class, 9, Side.SERVER);
}
示例4: preInit
import net.minecraftforge.fml.common.event.FMLPreInitializationEvent; //导入方法依赖的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();
}
示例5: preInit
import net.minecraftforge.fml.common.event.FMLPreInitializationEvent; //导入方法依赖的package包/类
@Mod.EventHandler
public void preInit(FMLPreInitializationEvent event) {
event.getModMetadata().version = VERSION;
log = event.getModLog();
devEnvChache = (Boolean) Launch.blackboard.get("fml.deobfuscatedEnvironment");
isMekanismLoaded = Loader.isModLoaded("mekanism");
NET_CHANNEL.registerMessage(PktCopyToClipboard.class, PktCopyToClipboard.class, 0, Side.CLIENT);
NET_CHANNEL.registerMessage(PktSyncSelection.class, PktSyncSelection.class, 1, Side.CLIENT);
proxy.loadModData(event.getModConfigurationDirectory());
proxy.preInit();
}