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


Java FMLPreInitializationEvent.getModMetadata方法代碼示例

本文整理匯總了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();
	
}
 
開發者ID:ArtixAllMighty,項目名稱:ExSartagine,代碼行數:23,代碼來源:ExSartagine.java

示例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);
}
 
開發者ID:OCDiary,項目名稱:TheOink,代碼行數:18,代碼來源:TheOink.java

示例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);
}
 
開發者ID:Yarichi,項目名稱:Proyecto-DASI,代碼行數:37,代碼來源:MalmoMod.java

示例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();
}
 
開發者ID:bl4ckscor3,項目名稱:GlobalXP,代碼行數:24,代碼來源:GlobalXP.java

示例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();
}
 
開發者ID:HellFirePvP,項目名稱:ModularMachinery,代碼行數:15,代碼來源:ModularMachinery.java


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