Java Code Examples for cpw.mods.fml.common.Mod.EventHandler

The following are top voted examples for showing how to use cpw.mods.fml.common.Mod.EventHandler. These examples are extracted from open source projects. You can vote up the examples you like and your votes will be used in our system to generate more good examples.
Example 1
Project: PAYDAY   File: PAYDAY.java   View source code 7 votes vote down vote up
@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);
}
 
Example 2
Project: connor41-etfuturum2   File: EtFuturum.java   View source code 7 votes vote down vote up
@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");
}
 
Example 3
Project: NoteblockTweak   File: NoteblockTweak.java   View source code 7 votes vote down vote up
@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");
  }
 
Example 4
Project: TFC-Tweaker   File: TFCTweaker.java   View source code 7 votes vote down vote up
@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);
	}
}
 
Example 5
Project: RorysMod   File: RorysMod.java   View source code 7 votes vote down vote up
@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);
}
 
Example 6
Project: FairyFactions   File: FairyFactions.java   View source code 7 votes vote down vote up
@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);
}
 
Example 7
Project: TRAPPIST-1   File: Core.java   View source code 6 votes vote down vote up
@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);

}
 
Example 8
Project: connor41-etfuturum2   File: EtFuturum.java   View source code 6 votes vote down vote up
@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);
}
 
Example 9
Project: connor41-etfuturum2   File: EtFuturum.java   View source code 6 votes vote down vote up
@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);
	}
}
 
Example 10
Project: HazardsLib   File: HazardsLib.java   View source code 6 votes vote down vote up
@EventHandler
public void init(FMLInitializationEvent event)
{
   	PacketHandler.init();
   	
	proxy.registerEventHandlers();
}
 
Example 11
Project: TFCPrimitiveTech   File: TFCPrimitiveTech.java   View source code 6 votes vote down vote up
@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();		
}
 
Example 12
Project: OpenSensors   File: OpenSensors.java   View source code 6 votes vote down vote up
@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);
}
 
Example 13
Project: Prospecting   File: Prospecting.java   View source code 6 votes vote down vote up
@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});
}
 
Example 14
Project: EnhancedLootBags   File: EnhancedLootBags.java   View source code 6 votes vote down vote up
@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() );
}
 
Example 15
Project: 4Space-5   File: GalacticraftPlanets.java   View source code 6 votes vote down vote up
@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);
}
 
Example 16
Project: FiveNightsAtFreddysUniverseMod   File: FNAFMod.java   View source code 6 votes vote down vote up
@EventHandler
public void preInit(FMLPreInitializationEvent event)
{
 	
	blockTile = new BlockTile(Material.rock).setBlockName("BlockTile").setBlockTextureName("fnafmod:tile_floor").setCreativeTab(tabFNAF);
	blockMultiTile = new BlockMultiTile(Material.rock).setBlockName("BlockMultiTile").setBlockTextureName("fnafmod:multi_tiled_floor").setCreativeTab(tabFNAF);
	
	GameRegistry.registerBlock(blockTile, blockTile.getUnlocalizedName().substring(5));
	GameRegistry.registerBlock(blockMultiTile, blockMultiTile.getUnlocalizedName().substring(5));
	System.out.println(blockTile.getUnlocalizedName().substring(5));
	System.out.println(blockMultiTile.getUnlocalizedName().substring(5));
	
   	FMLCommonHandler.instance().bus().register(FNAFMod.instance);   
   	FNAF_Blocks.register();
   	FNAFEntities.registerEntity();
      	proxy.registerRenderers();
      	
      	proxy.preInit();
}
 
Example 17
Project: 4Space-5   File: SpaceCore.java   View source code 6 votes vote down vote up
@EventHandler
   public void postInit(FMLPostInitializationEvent event) {
	SpaceLog.severe("Post-Init");
	
	createCreativeTabs();

	try {
		initMusic();
	} catch(NoSuchMethodError e) {
	//	e.printStackTrace();
	}
	
	for (ICoreModule module : modulesList) {
		module.loadRecipes();
	}
	
	proxy.postInit(event);
}
 
Example 18
Project: 4Space-5   File: SpaceCore.java   View source code 6 votes vote down vote up
@EventHandler
  public void serverInit(FMLServerStartedEvent event) {
SpaceLog.severe("Server-Init");

  	if (Constants.CHECK_VERSIONS) {
  		SpaceVersionCheck.startCheck();
  	}
  }
 
Example 19
Project: RorysMod   File: RorysMod.java   View source code 6 votes vote down vote up
@EventHandler
public void preInit(FMLPreInitializationEvent event) {
	instance = this;

	versionCheker = new Version();

	settings = new RorysConfig(event);
	settings.load(event);

	creativeTab = new CreativeTabs("rorysMobTab") {
		@Override
		public Item getTabIconItem() {
			return RorysMod.items.rifle1;
		}
	};

	blocks.preInit(event);
	items.preInit(event);
	achievements.preInit(event);

	blocks.register(event);
	items.register(event);

	PacketDispatcher.registerPackets();
}
 
Example 20
Project: ElementalElaboration   File: KorTech.java   View source code 5 votes vote down vote up
@EventHandler
public void preInit(FMLPreInitializationEvent e)
{
    config = new Configuration(e.getSuggestedConfigurationFile());
    ConfigurationKorTech.syncConfig();

    this.proxy.preInit(e);
}
 
Example 21
Project: TRAPPIST-1   File: Core.java   View source code 5 votes vote down vote up
@EventHandler
public void preInit(FMLPreInitializationEvent event) {

	TPBlocks.initialize();
	TPItems.initialize();
	TPDimensionConfig.initalize(new File(event.getModConfigurationDirectory(), "TrappistOne/dimension.cfg"));
	TPBiomeConfig.initalize(new File(event.getModConfigurationDirectory(), "TrappistOne/biome.cfg"));
	proxy.preload();
}
 
Example 22
Project: connor41-etfuturum2   File: EtFuturum.java   View source code 5 votes vote down vote up
@EventHandler
public void processIMCRequests(IMCEvent event) {
	for (IMCMessage message : event.getMessages())
		if (message.key.equals("register-brewing-fuel")) {
			NBTTagCompound nbt = message.getNBTValue();
			ItemStack stack = ItemStack.loadItemStackFromNBT(nbt.getCompoundTag("Fuel"));
			int brews = nbt.getInteger("Brews");
			BrewingFuelRegistry.registerFuel(stack, brews);
		}
}
 
Example 23
Project: TFCPrimitiveTech   File: TFCPrimitiveTech.java   View source code 5 votes vote down vote up
@EventHandler
	public void preInitialize(FMLPreInitializationEvent e)
	{
		instance = this;		
		
		// Load our settings
		proxy.loadOptions();
		
		proxy.registerTickHandler();
		
		ModBlocks.initialise();	

        FluidList.register();	

		// Register Key Bindings(Client only)
		proxy.registerKeys();
		// Register KeyBinding Handler (Client only)
		proxy.registerKeyBindingHandler();
		// Register Handler (Client only)
		proxy.registerHandlers();
		// Register Tile Entities
		proxy.registerTileEntities(true);
		// Register Sound Handler (Client only)
		proxy.registerSoundHandler();
		
		woodenClubMaterial = EnumHelper.addToolMaterial("woodenClub", 1,	120, 2, 80,	5);
		
		ModItems.initialise();
        
		
		// Register Gui Handler
		proxy.registerGuiHandler();		
//		proxy.registerWailaHandler();
	}
 
Example 24
Project: OpenSensors   File: OpenSensors.java   View source code 5 votes vote down vote up
@EventHandler
public void preInit(FMLPreInitializationEvent event) {
	long time = System.nanoTime();
	cfg = new Config(new Configuration(event.getSuggestedConfigurationFile()));
    ContentRegistry.preInit();
    logger.info("Finished pre-init in %d ms", (System.nanoTime() - time) / 1000000);
	
}
 
Example 25
Project: TerraFirmaProgressivePack   File: TFCPPHelper.java   View source code 5 votes vote down vote up
@EventHandler
public void preInitialize(FMLPreInitializationEvent e)
{
	instance = this;		
	
	// Load our settings
	proxy.loadOptions();
	
	proxy.registerTickHandler();
	
	TFCPPFluids.register();	

	TFCPPBlocks.initialise();	

	// Register Key Bindings(Client only)
	proxy.registerKeys();
	// Register KeyBinding Handler (Client only)
	proxy.registerKeyBindingHandler();
	// Register Handler (Client only)
	proxy.registerHandlers();
	// Register Tile Entities
	proxy.registerTileEntities(true);
	// Register Sound Handler (Client only)
	proxy.registerSoundHandler();
	
	TFCPPItems.initialise();
	
	TFCPPFluids.registerFluidContainers();	
	
	// Register Gui Handler
	proxy.registerGuiHandler();	
	// register worldgens
	GameRegistry.registerWorldGenerator(new WorldGenAbyssalFissure(TFCBlocks.lava, 2, true, TFCPPOptions.abyssalFissureRarity).setUnderground(false, 20).setSeed(1), 0);	
	GameRegistry.registerWorldGenerator(new WorldGenAbyssalFissure(TFCBlocks.hotWater, 2, false, TFCPPOptions.abyssalFissureRarity).setUnderground(false, 20).setSeed(2), 0);	
}
 
Example 26
Project: EnhancedLootBags   File: EnhancedLootBags.java   View source code 5 votes vote down vote up
@EventHandler
public void PreInit( FMLPreInitializationEvent pEvent )
{
	Rnd = new Random( System.currentTimeMillis() );
	ELBCfg = new ELBConfig( pEvent.getModConfigurationDirectory(), NICEFOLDERNAME, MODID );
	if (!ELBCfg.LoadConfig())
		Logger.error(String.format("%s could not load its config file. Things are going to be weird!", MODID));
       
	AdminLogonErrors = new IngameErrorLog();
	NW = new ELBDispatcher();
	NW.registerPackets();

	LootGroupHandler = new LootGroupsHandler( pEvent.getModConfigurationDirectory() );
	LootGroupHandler.LoadConfig();
	LootGroupHandler.registerBagItem();

	ELBCreativeTab = new CreativeTabs( "ELBTab" )
	{
		@Override
		@SideOnly( Side.CLIENT )
		public Item getTabIconItem()
		{
			return LootGroupHandler.getLootBagItem();
		}
	};

	LootGroupHandler.getLootBagItem().setCreativeTab( ELBCreativeTab );
}
 
Example 27
Project: TerrafirmaPunk-Tweaks   File: TerraFirmaPunkTweaks.java   View source code 5 votes vote down vote up
@EventHandler
public void postInit(FMLPostInitializationEvent event)
{        	    	
   	TFCTweaker.postInit();
   	
   	RecipeTweaks.SC2RecipeTweaks();
}
 
Example 28
Project: TweakCraft   File: TweakCraft.java   View source code 5 votes vote down vote up
@EventHandler
public void init(FMLInitializationEvent evt) {
	if (config == null) {
		Coreder.DEBUGGER.fatal("Configuration not found!");
		FMLCommonHandler.instance().exitJava(1, false);
	}
	Coreder.DEBUGGER.info("Registering items");
	registerItems();
	Coreder.DEBUGGER.info("Setting up event listeners");
	TweakCraftEventHandler evtHandler = new TweakCraftEventHandler();
	MinecraftForge.EVENT_BUS.register(evtHandler);
	FMLCommonHandler.instance().bus().register(instance);
	GameRegistry.addRecipe(evtHandler);
	GameRegistry.registerFuelHandler(evtHandler);
}
 
Example 29
Project: 4Space-5   File: GalacticraftCore.java   View source code 5 votes vote down vote up
@EventHandler
public void serverInit(FMLServerStartedEvent event)
{
    if (ThreadRequirementMissing.INSTANCE == null)
    {
        ThreadRequirementMissing.beginCheck(FMLCommonHandler.instance().getEffectiveSide());
    }

    ThreadVersionCheck.startCheck();
    TickHandlerServer.restart();
    BlockVec3.chunkCacheDim = Integer.MAX_VALUE;       
}
 
Example 30
Project: 4Space-5   File: GalacticraftCore.java   View source code 5 votes vote down vote up
@EventHandler
public void serverStarting(FMLServerStartingEvent event)
{
    event.registerServerCommand(new CommandSpaceStationAddOwner());
    event.registerServerCommand(new CommandSpaceStationChangeOwner());
    event.registerServerCommand(new CommandSpaceStationRemoveOwner());
    event.registerServerCommand(new CommandPlanetTeleport());
    event.registerServerCommand(new CommandKeepDim());
    event.registerServerCommand(new CommandGCInv());
    event.registerServerCommand(new CommandGCHelp());
    event.registerServerCommand(new CommandGCEnergyUnits());
    event.registerServerCommand(new CommandJoinSpaceRace());

    WorldUtil.initialiseDimensionNames();
    WorldUtil.registerSpaceStations(event.getServer().worldServerForDimension(0).getSaveHandler().getMapFileFromName("dummy").getParentFile());

    ArrayList<CelestialBody> cBodyList = new ArrayList<CelestialBody>();
    cBodyList.addAll(GalaxyRegistry.getRegisteredPlanets().values());
    cBodyList.addAll(GalaxyRegistry.getRegisteredMoons().values());

    for (CelestialBody body : cBodyList)
    {
        if (body.shouldAutoRegister())
        {
            if (!WorldUtil.registerPlanet(body.getDimensionID(), body.getReachable(), 0))
            	body.setUnreachable();
        }
    }
    
    RecipeManagerGC.setConfigurableRecipes();
}
 
Example 31
Project: MidgarCrusade   File: Main.java   View source code 5 votes vote down vote up
@EventHandler
public void 		serverLoad(FMLServerStartingEvent event)
{
event.registerServerCommand(new Command());
  MinecraftForge.EVENT_BUS.register(new ForgeEventHooksHandler());
	CommandLoader.load(event);
}
 
Example 32
Project: Age-of-Kingdom   File: AgeOfKingdom.java   View source code 5 votes vote down vote up
@EventHandler
public void preInit(FMLPreInitializationEvent event) {
    if(event.getSide().isClient()) {
        clientProxy = new ProxyClient();
    }
    serverProxy.preInit(event);
    packetManager.preInit(event);
}
 
Example 33
Project: Age-of-Kingdom   File: AgeOfKingdom.java   View source code 5 votes vote down vote up
@EventHandler
public void init(FMLInitializationEvent event) {
    NetworkRegistry.INSTANCE.registerGuiHandler(INSTANCE, serverProxy);
    GameRegistry.registerWorldGenerator(blockGenerator, 0);

    serverProxy.init(event);
    blockManager.init(event);
    itemManager.init(event);
    eventManager.init(event);
    entityManager.init(event);
    questManager.init(event);
    PlayerAokIEEP.init();
}
 
Example 34
Project: MinecraftSolder   File: MinecraftSolder.java   View source code 5 votes vote down vote up
@EventHandler
public void postinit(FMLPostInitializationEvent event) throws Exception {
    if(event.getSide().isServer() && solderConfig.isEnabled()){
        if(modpack.needsBuild()){
            modpack.build();
        }
    }
}
 
Example 35
Project: Rival-Rebels-Mod   File: RivalRebels.java   View source code 5 votes vote down vote up
@EventHandler
public void serverStarting(FMLServerStartingEvent event)
{
	ICommandManager commandManager = MinecraftServer.getServer().getCommandManager();
	ServerCommandManager serverCommandManager = ((ServerCommandManager) commandManager);
	addCommands(serverCommandManager);
}
 
Example 36
Project: TerraFirmaProgressivePack   File: TFCPPHelper.java   View source code 5 votes vote down vote up
@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 TFCPPPlayerTracker());
	
	// 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();

	TFCPPRecipes.initialise();
	
	// Register WAILA classes
	proxy.registerWailaClasses();
	proxy.hideNEIItems();		
}
 
Example 37
Project: PopularMMOS-EpicProportions-Mod   File: EpicProportionsMod.java   View source code 5 votes vote down vote up
@EventHandler
public void serverStart(FMLServerStartingEvent event)
{
	//Thread.currentThread().setName("EpicProportionsMod");
     MinecraftServer server = MinecraftServer.getServer();
     // Get's the current server instance
     
     ICommandManager command = server.getCommandManager();
     ServerCommandManager manager = (ServerCommandManager) command;
     
     manager.registerCommand(new CommandModInfo());
     manager.registerCommand(new CommandChangelog());
}
 
Example 38
Project: VivecraftForgeExtensions   File: VivecraftForge.java   View source code 5 votes vote down vote up
@EventHandler
public void preInit(FMLPreInitializationEvent event) {
	Configuration config = new Configuration(event.getSuggestedConfigurationFile());
	config.load();
	Config.vrCreeperSwellDistance = config.get(Configuration.CATEGORY_GENERAL, "vrCreeperSwellDistance", 1.75, "Distance at which creepers swell and explode for VR players. Default: 1.75").getDouble(1.75D);
	if (config.hasChanged()) config.save();
}
 
Example 39
Project: VivecraftForgeExtensions   File: VivecraftForge.java   View source code 5 votes vote down vote up
@EventHandler
public void load(FMLInitializationEvent event) {
	packetPipeline = VivecraftForgeChannelHandler.init();
	proxy.registerNetworkChannels();
	proxy.registerEventHandlers();
	proxy.registerEntities();
	proxy.registerRenderers();
}
 
Example 40
Project: CheatyComputers   File: CheatyComputers.java   View source code 5 votes vote down vote up
@EventHandler
public void preInit(FMLPreInitializationEvent e) {
	log = e.getModLog();
	//MinecraftForge.EVENT_BUS.register(this);
	//FMLCommonHandler.instance().bus().register(this);
	config = new Configuration(e.getSuggestedConfigurationFile());
	//config.load();
	tab = CreativeTab.instance;
	item = new ItemPackage();
	GameRegistry.registerItem(item, "cheatycomputers.package");
}