當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。