本文整理汇总了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);
}
示例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");
}
示例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");
}
示例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);
}
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}
}
示例10: init
import cpw.mods.fml.common.Mod.EventHandler; //导入依赖的package包/类
@EventHandler
public void init(FMLInitializationEvent event)
{
PacketHandler.init();
proxy.registerEventHandlers();
}
示例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();
}
示例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);
}
示例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});
}
示例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() );
}
示例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);
}