当前位置: 首页>>代码示例>>Java>>正文


Java Mod.EventHandler方法代码示例

本文整理汇总了Java中cpw.mods.fml.common.Mod.EventHandler方法的典型用法代码示例。如果您正苦于以下问题:Java Mod.EventHandler方法的具体用法?Java Mod.EventHandler怎么用?Java Mod.EventHandler使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在cpw.mods.fml.common.Mod的用法示例。


在下文中一共展示了Mod.EventHandler方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: init

import cpw.mods.fml.common.Mod; //导入方法依赖的package包/类
@Mod.EventHandler
public void init(FMLInitializationEvent event) {
    Configurator.configure(new File("config/" + MODID + ".cfg"));
    GameRegistry.registerWorldGenerator(new Decorator(), 4096);
    FMLCommonHandler.instance().bus().register(this);
    MinecraftForge.EVENT_BUS.register(this);
}
 
开发者ID:ternsip,项目名称:StructPro,代码行数:8,代码来源:Structpro.java

示例2: init

import cpw.mods.fml.common.Mod; //导入方法依赖的package包/类
@Mod.EventHandler
public void init(FMLInitializationEvent event)
{
	proxy.init(event);
	
	
	ItemLoader.LoadItems();
	//BlockLoader.loadBlocks();
	Recipes.registerRecpies();
	//EntityLoader.LoadEntitys();
	//OreDict.addores();
	Achievements.loadAchievements();
	Stats.RegisterStats();

	PlayerChecker.checkPlayer(username);
	LootRegistry.registerLoot();
	
}
 
开发者ID:jtrent238,项目名称:Hammer-Mod,代码行数:19,代码来源:HammerMod.java

示例3: init

import cpw.mods.fml.common.Mod; //导入方法依赖的package包/类
@Mod.EventHandler
public void init(FMLInitializationEvent event) {
	proxy.registerNetworkStuff();
	NetworkRegistry.INSTANCE.registerGuiHandler(this, new TechnicalGuiHandler());
	TechnicalItem.removeVanillaRecipes();
	Recipes.init();
	FMLCommonHandler.instance().bus().register(new EventListener());
	radioactivityPotion = (new PotionTechnical(radioactivityPotionId, true, 0)).setIconIndex(0, 0).setPotionName("potion.radioactivityPotion");
	TechnicalAchievement.init();
	AchievementPage.registerAchievementPage(technicalAchievementPage);
}
 
开发者ID:viddeno,项目名称:Technical,代码行数:12,代码来源:Technical.java

示例4: init

import cpw.mods.fml.common.Mod; //导入方法依赖的package包/类
/**
 * This is the second pass of logic in this mod.
 */
@Mod.EventHandler
public void init(FMLInitializationEvent event)
{
	InitEvent e;
	e = new InitEvent();
	e.Go(event);
}
 
开发者ID:SneakyTactician,项目名称:BIGB,代码行数:11,代码来源:BIGB.java

示例5: postInit

import cpw.mods.fml.common.Mod; //导入方法依赖的package包/类
@Mod.EventHandler
public void postInit(FMLPostInitializationEvent event) {
	{
		//Thread.currentThread().setName("EpicProportionsMod");
		
		MinecraftForge.EVENT_BUS.register(new WorldGenModFlower(BlockLoader.blockFlowerChocolate));
		MinecraftForge.EVENT_BUS.register(new WorldGenModFlower(BlockLoader.blockFlowerForJen));
		MinecraftForge.EVENT_BUS.register(new WorldGenModFlower(BlockLoader.blockFlowerLove));
		MinecraftForge.EVENT_BUS.register(new WorldGenModFlower(BlockLoader.blockFlowerPinkHeart));
		MinecraftForge.EVENT_BUS.register(new WorldGenModFlower(BlockLoader.blockFlowerRainbow));
		MinecraftForge.EVENT_BUS.register(new WorldGenModFlower(BlockLoader.blockFlowerRedHeart));
		MinecraftForge.EVENT_BUS.register(new CustomPresentDrops());
		MinecraftForge.EVENT_BUS.register(new VersionChecker());
		MinecraftForge.EVENT_BUS.register(new CommandModInfo());
		//MinecraftForge.EVENT_BUS.register(new PotionLoader(33, false, 8171462));
		//MinecraftForge.EVENT_BUS.register(new PotionLoader(33, false, 8171462));
		MinecraftForge.EVENT_BUS.register(new WorldGenPumpkin_Pat());
		MinecraftForge.EVENT_BUS.register(new WorldGenPumpkin_Jen());
		MinecraftForge.EVENT_BUS.register(new StructureVillagePieces());
		//MinecraftForge.EVENT_BUS.register(new Yggdrasil());
		MinecraftForge.EVENT_BUS.register(new LogHelper());
		//MinecraftForge.EVENT_BUS.register(new CommandModInfo());
        //MinecraftForge.EVENT_BUS.register(new BiomeGenPat(getBIOME_ID_PAT()));
        //MinecraftForge.EVENT_BUS.register(new BiomeGenJen(getBIOME_ID_JEN()));
        //MinecraftForge.EVENT_BUS.register(new WorldProviderEpicProportions());
        //MinecraftForge.EVENT_BUS.register(new EpicProportionsBiomes(ENTITY_ID_0, null));
		//MinecraftForge.EVENT_BUS.register(new RenderGuiHandler());
		//MinecraftForge.ORE_GEN_BUS.register(new BiomeDecorator());
        
	    Recipes.registerRecpies();

	    MinecraftForge.EVENT_BUS.register(new CommandChangelog());
	    
	    //MUhTTawz.maAzeRcL();
	}
	
	
}
 
开发者ID:jtrent238,项目名称:PopularMMOS-EpicProportions-Mod,代码行数:39,代码来源:EpicProportionsMod.java

示例6: onInit

import cpw.mods.fml.common.Mod; //导入方法依赖的package包/类
@Mod.EventHandler
public void onInit(FMLInitializationEvent e){
    /*
    REGISTERS ALL COMMON THINGS SO FOR BOTH SERVER AND CLIENT...
     */
    LOTRAddonsItems.registerRings();
    LOTRAddonsBlocks.registerBlocks();
    LOTRAddonsEntities.registerEntities();
    NetworkRegistry.INSTANCE.registerGuiHandler(LOTRAddons.lotrAddons, new GuiHandler());


}
 
开发者ID:TimVerhaegen,项目名称:LotrAddonsRings,代码行数:13,代码来源:ProxyCommon.java

示例7: preInit

import cpw.mods.fml.common.Mod; //导入方法依赖的package包/类
@Mod.EventHandler
public void preInit(FMLPreInitializationEvent event){
    if (event.getSide() == Side.SERVER) {
        logger.info("Client side only mod - not doing anything on the server!");
        return;
    }
}
 
开发者ID:Cloudhunter,项目名称:LetsEncryptRoot,代码行数:8,代码来源:LetsEncryptRoot.java

示例8: serverStarting

import cpw.mods.fml.common.Mod; //导入方法依赖的package包/类
@Mod.EventHandler
public void serverStarting(FMLServerStartingEvent event)
{
    event.registerServerCommand(new CommandInvite());
    event.registerServerCommand(new CommandPregen());
    deserializePreload(new File(getSaveFolder(), "pregenData.json"));
}
 
开发者ID:CreeperHost,项目名称:CreeperHostGui,代码行数:8,代码来源:CreeperHostServer.java

示例9: serverStopping

import cpw.mods.fml.common.Mod; //导入方法依赖的package包/类
@Mod.EventHandler
public void serverStopping(FMLServerStoppingEvent event)
{
    if (!CreeperHost.instance.active)
        return;
    serverOn = false;
    serializePreload();
    pregenTasks.clear();
}
 
开发者ID:CreeperHost,项目名称:CreeperHostGui,代码行数:10,代码来源:CreeperHostServer.java

示例10: preInit

import cpw.mods.fml.common.Mod; //导入方法依赖的package包/类
@Mod.EventHandler
public void preInit(FMLPreInitializationEvent e)
{
    if (!CreeperHost.instance.active)
        return;
    MinecraftForge.EVENT_BUS.register(this);
    FMLCommonHandler.instance().bus().register(this);
    logger = e.getModLog();
}
 
开发者ID:CreeperHost,项目名称:CreeperHostGui,代码行数:10,代码来源:CreeperHostServer.java

示例11: preInit

import cpw.mods.fml.common.Mod; //导入方法依赖的package包/类
@Mod.EventHandler
public void preInit(FMLPreInitializationEvent event) {
	TechnicalBlock.registerBlocks();
	TechnicalItem.registerItems();
	TechnicalTools.registerTools();
	GameRegistry.registerWorldGenerator(this.eventWorldGen, 0);

	proxy.registerTileEntities();
	
	((Item) Item.itemRegistry.getObject("water_bucket")).setMaxStackSize(16);
	
	for (int i = 0; i < 5; ++i) {
		VillagerRegistry.instance().registerVillageTradeHandler(i, new TradeHandler());
	}

	Potion[] potionTypes;
	for (Field f : Potion.class.getDeclaredFields()) {
		f.setAccessible(true);
		try {
			if (f.getName().equals("potionTypes") || f.getName().equals("field_76425_a")) {
				Field modfield = Field.class.getDeclaredField("modifiers");
				modfield.setAccessible(true);
				modfield.setInt(f, f.getModifiers() & ~Modifier.FINAL);
				potionTypes = (Potion[]) f.get(null);
				final Potion[] newPotionTypes = new Potion[256];
				System.arraycopy(potionTypes, 0, newPotionTypes, 0, potionTypes.length);
				f.set(null, newPotionTypes);
			}
		} catch (Exception e) {
			e.printStackTrace();
		}
	}
	MinecraftForge.EVENT_BUS.register(new TechnicalEventHooks());
	MinecraftForge.ORE_GEN_BUS.register(new TechnicalOreGenEventHooks());
}
 
开发者ID:viddeno,项目名称:Technical,代码行数:36,代码来源:Technical.java

示例12: postInit

import cpw.mods.fml.common.Mod; //导入方法依赖的package包/类
@Mod.EventHandler
public void postInit(FMLPostInitializationEvent event) throws IOException {
    BufferedReader br = new BufferedReader(new FileReader(islands.getPath()));
    if (br.readLine() == null) {
        logger.info("Islands file empty, placing a default value.");
        IslandCreator.islandLocations.put("default", new IslandCreator.IslandPos(0, 60, 0));
        try {
            saveIslands(IslandCreator.islandLocations);
        } catch (IOException e) {
            e.printStackTrace();
        }
    }
    br.close();
}
 
开发者ID:Kolatra,项目名称:FTB-Islands,代码行数:15,代码来源:FTBIslands.java

示例13: init

import cpw.mods.fml.common.Mod; //导入方法依赖的package包/类
@Mod.EventHandler
@SuppressWarnings("unused")
public void init(FMLInitializationEvent event) {
    proxy.registerRenderer();
    AntiMatterModRegistry.registerInit(event);
    AMMRegistry.INSTANCE.handleInit();
    RecipeRegister.beforeRemoveRecipeinit(event);
    RecipeRegister.RecipeRegisterInit(event);
    RecipeRegister.afterRemoveRecipeinit(event);
}
 
开发者ID:Team-Antimatter-Mod,项目名称:AntiMatterMod,代码行数:11,代码来源:AntiMatterModCore.java

示例14: preInit

import cpw.mods.fml.common.Mod; //导入方法依赖的package包/类
/**
 * This is the first pass of logic in this mod.
 */
@Mod.EventHandler
public void preInit(FMLPreInitializationEvent event)
{
	PreInitEvent e;
	e = new PreInitEvent();
	e.Go(event);

}
 
开发者ID:SneakyTactician,项目名称:BIGB,代码行数:12,代码来源:BIGB.java

示例15: preInit

import cpw.mods.fml.common.Mod; //导入方法依赖的package包/类
@Mod.EventHandler
@SideOnly(Side.CLIENT)
public void preInit(FMLPreInitializationEvent e)
{
	Configuration config = new Configuration(e.getSuggestedConfigurationFile());
	config.load();
	//读取配置文件
	ConfigVar.onlinecheck = config.get("Online", "Check", false).getBoolean();
	ConfigVar.version = config.get("Online", "Version", "v1.0").getString();
	ConfigVar.url = config.get("Online", "url", "http://127.0.0.1/").getString();
	ConfigVar.IsTwoAddress = config.get("Server", "1sTwoAddress", false).getBoolean();
	ConfigVar.ServerAddress = config.get("Server", "Address1", "127.0.0.1").getString();
	ConfigVar.ServerAddress1 = config.get("Server", "Address2", "127.0.0.1").getString();
	ConfigVar.Captain = config.get("Server", "Captain", "Minecraft 1.7.10").getString();
	ConfigVar.announcement = config.get("Server", "Announcement", "").getString();
	ConfigVar.announcementmove = config.get("Server", "AnnouncementMove", false).getBoolean();
	ConfigVar.debug = config.get("General", "debugMode", false).getBoolean();
	ConfigVar.ChangeLogFilename = config.get("Online", "ChangelogFilename", "NewMenuChangelog.txt").getString();
	ConfigVar.JsonFilename = config.get("Online", "JsonFilename", "NewMenu.json").getString();
	config.save();
	//结束读取
	if(ConfigVar.onlinecheck)
	{
		this.changeLog = InternetUtil.LoadText(ConfigVar.url + "/" + ConfigVar.ChangeLogFilename);
		this.jsonString = InternetUtil.LoadText(ConfigVar.url + "/" + ConfigVar.JsonFilename);
	}

	Display.setTitle(ConfigVar.Captain);
	MinecraftForge.EVENT_BUS.register(NewMenuHandler.instance);
}
 
开发者ID:yeyaowei,项目名称:New-Menu,代码行数:31,代码来源:Menu.java


注:本文中的cpw.mods.fml.common.Mod.EventHandler方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。