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


Java EventHandler类代码示例

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


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

示例1: init

import cpw.mods.fml.common.Mod.EventHandler; //导入依赖的package包/类
@EventHandler
public void init(FMLInitializationEvent evt) {
	INSTANCE.registerMessage(LobbyPlayerOpenedGuiPacketHandler.class, LobbyPlayerOpenedGuiPacket.class, 0,
			Side.SERVER);

	INSTANCE.registerMessage(LobbyBeginGamePacketHandler.class, LobbyBeginGamePacket.class, 1, Side.SERVER);
	INSTANCE.registerMessage(PacketSyncPlayerPropertiesClientHandler.class, PacketSyncPlayerPropertiesClient.class,
			2, Side.CLIENT);
	INSTANCE.registerMessage(PacketSyncPlayerPropertiesServerHandler.class, PacketSyncPlayerPropertiesServer.class,
			3, Side.SERVER);

	INSTANCE.registerMessage(PacketSyncTileEntityServerHandler.class, PacketSyncTileEntityServer.class, 4,
			Side.SERVER);
	INSTANCE.registerMessage(PacketSyncTileEntityClientHandler.class, PacketSyncTileEntityClient.class, 5,
			Side.CLIENT);

	NetworkRegistry.INSTANCE.registerGuiHandler(PAYDAY.instance, new MGuiHandler());
	GameRegistry.registerBlock(lobbyBlock, "Lobby");
	GameRegistry.registerTileEntity(LobbyTileEntity.class, "lobby_tile_entity");

	FMLCommonHandler.instance().bus().register(eventHandler);
	MinecraftForge.EVENT_BUS.register(eventHandler);
}
 
开发者ID:TominoCZ,项目名称:PAYDAY,代码行数:24,代码来源:PAYDAY.java

示例2: init

import cpw.mods.fml.common.Mod.EventHandler; //导入依赖的package包/类
@EventHandler
public void init(FMLInitializationEvent event) {
	NetworkRegistry.INSTANCE.registerGuiHandler(instance, proxy);

	ModRecipes.init();

	proxy.registerEvents();
	proxy.registerEntities();
	proxy.registerRenderers();

	if (ModEntityList.hasEntitiesWithEggs()) {
		ModEntityList.entity_egg = new ItemEntityEgg();
		GameRegistry.registerItem(ModEntityList.entity_egg, "entity_egg");
		OreDictionary.registerOre("mobEgg", ModEntityList.entity_egg);
	}

	isTinkersConstructLoaded = Loader.isModLoaded("TConstruct");
}
 
开发者ID:jm-organization,项目名称:connor41-etfuturum2,代码行数:19,代码来源:EtFuturum.java

示例3: init

import cpw.mods.fml.common.Mod.EventHandler; //导入依赖的package包/类
@EventHandler
  public void init(FMLInitializationEvent event)
  {
MinecraftForge.EVENT_BUS.register(new NoteblockPlaceHandler());
cpw.mods.fml.common.FMLCommonHandler.instance().bus().register(new CreditNotifer());
INSTANCE.registerMessage(BlockMessageHandler.class, BlockMessage.class, 0, Side.SERVER);
INSTANCE.registerMessage(BlockEnhancedMessageHandler.class, BlockEnhancedMessage.class, 1, Side.SERVER);
Mapping.init();
RealPianoMapping.init();
itemNbT = new ItemNoteblockFork();
itemNbT.setUnlocalizedName("noteblockfork");
itemNbT.setTextureName("noteblocktweak:noteblock_fork_hand");
itemNbT.setMaxStackSize(1);
itemNbT.setCreativeTab(CreativeTabs.tabTools);
GameRegistry.registerItem(itemNbT, "NoteblockFork");
BLOCKN = new BlockEnhancedNote();
GameRegistry.registerBlock(BLOCKN, "EnhancedNoteBlock");
GameRegistry.registerTileEntity(TileEntityEnhancedNote.class, "tileenhancednote");
  }
 
开发者ID:cqjjjzr,项目名称:NoteblockTweak,代码行数:20,代码来源:NoteblockTweak.java

示例4: initialize

import cpw.mods.fml.common.Mod.EventHandler; //导入依赖的package包/类
@EventHandler
public void initialize(FMLInitializationEvent event)
{
	TerraFirmaCraft.PACKET_PIPELINE.registerPacket(InitClientWorldPacket.class);
	FMLCommonHandler.instance().bus().register(new PlayerTracker());
	MinecraftForge.EVENT_BUS.register(new ChunkEventHandler());
	MinecraftForge.EVENT_BUS.register(new PlayerInteractionHandler());
	MinecraftForge.EVENT_BUS.register(new AnvilCraftingHandler());
	
	if (Loader.isModLoaded("MineTweaker3"))
	{
		MineTweakerAPI.registerClass(ItemHeat.class);
		MineTweakerAPI.registerClass(Loom.class);
		MineTweakerAPI.registerClass(Quern.class);
		MineTweakerAPI.registerClass(Barrel.class);
		MineTweakerAPI.registerClass(Anvil.class);
		MineTweakerAPI.registerClass(Knapping.class);
	}
}
 
开发者ID:StrayWolfe,项目名称:TFC-Tweaker,代码行数:20,代码来源:TFCTweaker.java

示例5: init

import cpw.mods.fml.common.Mod.EventHandler; //导入依赖的package包/类
@EventHandler
public void init(FMLInitializationEvent event) {
	RMLog.info("Registering Recipes");
	blocks.init(event);
	items.init(event);
	achievements.init(event);

	RMLog.info("Registering everything else");

	Register.registerGUI(new GuiHandler());

	registerEventHandlers();
	registerTileEntities();
	registerModEntities();

	proxy.init(event);
}
 
开发者ID:roryclaasen,项目名称:RorysMod,代码行数:18,代码来源:RorysMod.java

示例6: init

import cpw.mods.fml.common.Mod.EventHandler; //导入依赖的package包/类
@EventHandler
public void init(FMLInitializationEvent event) {
	FairyEventListener listener = new FairyEventListener();
	MinecraftForge.EVENT_BUS.register(listener);

	proxy.initEntities();
	LOGGER.debug("Registered entities");

	proxy.initChannel(listener);
	LOGGER.debug("Registered channel");

	/*
	FMLCommonHandler.instance().bus().register(this);
	LOGGER.debug("Registered events");
	*/

	proxy.initGUI();
	LOGGER.debug("Registered GUI");

	LOGGER.info("Loaded version %s", Version.VERSION);
}
 
开发者ID:allaryin,项目名称:FairyFactions,代码行数:22,代码来源:FairyFactions.java

示例7: init

import cpw.mods.fml.common.Mod.EventHandler; //导入依赖的package包/类
@EventHandler
public void init(FMLInitializationEvent event) {
	proxy.load();
	this.registerEntities();
	// TODO Register Planets: -------------------------------

	TrappistOnePlanets.init();

	TPCreativeTabs.TPBlocksTab = new CreativeTabGC(CreativeTabs.getNextID(), "TPBlocks", Item.getItemFromBlock(Blocks.grass), 0);
	TPCreativeTabs.TPItemsTab = new CreativeTabGC(CreativeTabs.getNextID(), "TPItems", TPItems.itemAlienGel, 0);
	TPCreativeTabs.TPArmorTab = new CreativeTabGC(CreativeTabs.getNextID(), "TPArmor", Items.diamond_helmet, 0);

}
 
开发者ID:BlesseNtumble,项目名称:TRAPPIST-1,代码行数:14,代码来源:Core.java

示例8: preInit

import cpw.mods.fml.common.Mod.EventHandler; //导入依赖的package包/类
@EventHandler
public void preInit(FMLPreInitializationEvent event) {
	ConfigurationHandler.INSTANCE.init(new File(event.getModConfigurationDirectory().getAbsolutePath() + File.separator + Reference.MOD_ID + ".cfg"));

	GameRegistry.registerWorldGenerator(new EtFuturumWorldGenerator(), 0);
	GameRegistry.registerWorldGenerator(new EtFuturumNetherGenerator(), 1);

	ModBlocks.init();
	ModItems.init();
	ModEnchantments.init();

	OceanMonument.makeMap();

	NetworkRegistry.INSTANCE.registerGuiHandler(instance, proxy);
	networkWrapper = NetworkRegistry.INSTANCE.newSimpleChannel(Reference.MOD_ID);
	networkWrapper.registerMessage(ArmourStandInteractHandler.class, ArmourStandInteractMessage.class, 0, Side.SERVER);
	networkWrapper.registerMessage(BlackHeartParticlesHandler.class, BlackHeartParticlesMessage.class, 1, Side.CLIENT);
	networkWrapper.registerMessage(SetPlayerModelHandler.class, SetPlayerModelMessage.class, 2, Side.CLIENT);
}
 
开发者ID:jm-organization,项目名称:connor41-etfuturum2,代码行数:20,代码来源:EtFuturum.java

示例9: postInit

import cpw.mods.fml.common.Mod.EventHandler; //导入依赖的package包/类
@EventHandler
public void postInit(FMLPostInitializationEvent event) {
	Items.blaze_rod.setFull3D();
	Blocks.trapped_chest.setCreativeTab(CreativeTabs.tabRedstone);

	if (enableUpdatedFoodValues) {
		setFinalField(ItemFood.class, Items.carrot, 3, "healAmount", "field_77853_b");
		setFinalField(ItemFood.class, Items.baked_potato, 5, "healAmount", "field_77853_b");
	}

	if (enableUpdatedHarvestLevels) {
		Blocks.packed_ice.setHarvestLevel("pickaxe", 0);
		Blocks.ladder.setHarvestLevel("axe", 0);
		Blocks.melon_block.setHarvestLevel("axe", 0);
	}
}
 
开发者ID:jm-organization,项目名称:connor41-etfuturum2,代码行数:17,代码来源:EtFuturum.java

示例10: init

import cpw.mods.fml.common.Mod.EventHandler; //导入依赖的package包/类
@EventHandler
public void init(FMLInitializationEvent event)
{
   	PacketHandler.init();
   	
	proxy.registerEventHandlers();
}
 
开发者ID:TwilightWingsStudio,项目名称:HazardsLib,代码行数:8,代码来源:HazardsLib.java

示例11: initialize

import cpw.mods.fml.common.Mod.EventHandler; //导入依赖的package包/类
@EventHandler
public void initialize(FMLInitializationEvent e)
{
	// Register packets in the TFC PacketPipeline
	TerraFirmaCraft.PACKET_PIPELINE.registerPacket(InitClientWorldPacket.class);
	
	// Register the player tracker
	FMLCommonHandler.instance().bus().register(new ModPlayerTracker());
	
	// Register the tool classes
	proxy.registerToolClasses();

	// Register Crafting Handler
	FMLCommonHandler.instance().bus().register(new CraftingHandler());

	// Register the Chunk Load/Save Handler
	MinecraftForge.EVENT_BUS.register(new ChunkEventHandler());
	
	// Register all the render stuff for the client
	proxy.registerRenderInformation();

       FluidList.registerFluidContainers();
       
	ModRecipes.initialise();
	
	// Register WAILA classes
	proxy.registerWailaClasses();
	proxy.hideNEIItems();		
}
 
开发者ID:Wahazar,项目名称:TFCPrimitiveTech,代码行数:30,代码来源:TFCPrimitiveTech.java

示例12: init

import cpw.mods.fml.common.Mod.EventHandler; //导入依赖的package包/类
@EventHandler
public void init(FMLInitializationEvent event) {
	long time = System.nanoTime();
	ContentRegistry.init();
	FMLCommonHandler.instance().bus().register(this);
	NetworkRegistry.INSTANCE.registerGuiHandler(OpenSensors.instance, new GUIHandler());
	logger.info("Finished init in %d ms", (System.nanoTime() - time) / 1000000);
}
 
开发者ID:PC-Logix,项目名称:OpenSensors,代码行数:9,代码来源:OpenSensors.java

示例13: init

import cpw.mods.fml.common.Mod.EventHandler; //导入依赖的package包/类
@EventHandler
public void init(FMLInitializationEvent event) {
	GameRegistry.registerWorldGenerator(new ProspectingWorldGen(), 1000);

	GameRegistry.addRecipe(new ItemStack(ProspectingItems.prospecting_pan), new Object[] {"s s", " s ", 's', Blocks.stone_slab});
	GameRegistry.addRecipe(new ItemStack(ProspectingItems.prospecting_pick), new Object[] {"iis", "  s", 'i', Items.iron_ingot, 's', Items.stick});
	GameRegistry.addRecipe(new ItemStack(ProspectingItems.sifting_pan), new Object[] {"s s", "s#s", "s#s", 's', Items.stick, '#', Items.string});
}
 
开发者ID:azacock,项目名称:Prospecting,代码行数:9,代码来源:Prospecting.java

示例14: init

import cpw.mods.fml.common.Mod.EventHandler; //导入依赖的package包/类
@EventHandler
public void init( FMLInitializationEvent event )
{
	FMLCommonHandler.instance().bus().register( AdminLogonErrors );
	FMLCommonHandler.instance().bus().register( LootGroupHandler );
	MinecraftForge.EVENT_BUS.register( LootGroupHandler );
	NetworkRegistry.INSTANCE.registerGuiHandler( this, new GuiHandler() );
}
 
开发者ID:GTNewHorizons,项目名称:EnhancedLootBags,代码行数:9,代码来源:EnhancedLootBags.java

示例15: preInit

import cpw.mods.fml.common.Mod.EventHandler; //导入依赖的package包/类
@EventHandler
public void preInit(FMLPreInitializationEvent event)
{
    FMLCommonHandler.instance().bus().register(this);
    
    //Initialise configs, converting mars.conf + asteroids.conf to planets.conf if necessary
    File oldMarsConf = new File(event.getModConfigurationDirectory(), "Galacticraft/mars.conf");
    File newPlanetsConf = new File(event.getModConfigurationDirectory(), "Galacticraft/planets.conf");
    boolean update = false;
    if (oldMarsConf.exists())
    {
    	oldMarsConf.renameTo(newPlanetsConf);
    	update = true;
    }
    new ConfigManagerMars(newPlanetsConf, update);
    new ConfigManagerAsteroids(new File(event.getModConfigurationDirectory(), "Galacticraft/asteroids.conf"));

    GalacticraftPlanets.commonModules.put(GalacticraftPlanets.MODULE_KEY_MARS, new MarsModule());
    GalacticraftPlanets.commonModules.put(GalacticraftPlanets.MODULE_KEY_ASTEROIDS, new AsteroidsModule());
    GalacticraftPlanets.proxy.preInit(event);
}
 
开发者ID:4Space,项目名称:4Space-5,代码行数:22,代码来源:GalacticraftPlanets.java


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