Java Code Examples for cpw.mods.fml.common.event.FMLServerStartingEvent

The following are top voted examples for showing how to use cpw.mods.fml.common.event.FMLServerStartingEvent. 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: WorldBorder-Forge   File: WorldBorder.java   View source code 6 votes vote down vote up
@Mod.EventHandler
@SideOnly(Side.SERVER)
public void serverStart(FMLServerStartingEvent event)
{
    if (INSTANCE == null) INSTANCE = this;
    if (SERVER   == null) SERVER   = event.getServer();
    if (COMMAND  == null) COMMAND  = new WBCommand();

    // Load (or create new) config files
    Config.load(false);

    // our one real command, though it does also have aliases "wb" and "worldborder"
    event.registerServerCommand(COMMAND);

    if ( Config.preventBlockPlace() )
        enableBlockPlaceListener(true);

    if ( Config.preventMobSpawn() )
        enableMobSpawnListener(true);

    if ( Config.getDenyEnderpearl() )
        enableEnderPearlListener(true);

    DynMapFeatures.registerListener();
}
 
Example 2
Project: vsminecraft   File: Mekanism.java   View source code 6 votes vote down vote up
@EventHandler
public void serverStarting(FMLServerStartingEvent event)
{
	if(general.voiceServerEnabled)
	{
		voiceManager.start();
	}
	
	//Load cached furnace recipes
	Recipe.ENERGIZED_SMELTER.get().clear();
	
	for(Object obj : FurnaceRecipes.smelting().getSmeltingList().entrySet())
	{
		Map.Entry<ItemStack, ItemStack> entry = (Map.Entry<ItemStack, ItemStack>)obj;
		SmeltingRecipe recipe = new SmeltingRecipe(new ItemStackInput(entry.getKey()), new ItemStackOutput(entry.getValue()));
		Recipe.ENERGIZED_SMELTER.put(recipe);
	}
	
	event.registerServerCommand(new CommandMekanism());
}
 
Example 3
Project: burlapcraft   File: BurlapCraft.java   View source code 6 votes vote down vote up
@EventHandler
  public void serverLoad(FMLServerStartingEvent event)
  {
      // register server commands
  	event.registerServerCommand(new CommandTeleport());
  	event.registerServerCommand(new CommandSmoothMove());
  	event.registerServerCommand(new CommandAStar());
  	event.registerServerCommand(new CommandBFS());
  	event.registerServerCommand(new CommandVI());
  	event.registerServerCommand(new CommandRMax());
  	event.registerServerCommand(new CommandCreateDungeons());
      event.registerServerCommand(new CommandInventory());
      event.registerServerCommand(new CommandCheckState());
      event.registerServerCommand(new CommandResetDungeon());
      event.registerServerCommand(new CommandCheckProps());
  	event.registerServerCommand(new CommandTest());
  	event.registerServerCommand(new CommandTerminalExplore());
      event.registerServerCommand(new CommandCurrentPath());
event.registerServerCommand(new CommandReachable());
      
  }
 
Example 4
Project: CrayCrafting   File: CrayCrafting.java   View source code 6 votes vote down vote up
@Mod.EventHandler()
public void eventHandler(FMLServerStartingEvent event)
{
    RecipeRegistry.setConfigFromServer(listType, list);

    recipeFile = new File(DimensionManager.getCurrentSaveRootDirectory(), MODID + ".dat");
    if (recipeFile.exists())
    {
        try
        {
            RecipeRegistry.loadRecipesFromNBT(CompressedStreamTools.read(recipeFile));
        }
        catch (Exception e)
        {
            e.printStackTrace();
        }
    }
    else
    {
        RecipeRegistry.randomizeRecipes(recipeFile);
    }

    if (timer > 0) setupTimer();
}
 
Example 5
Project: RedGen   File: RedGen.java   View source code 6 votes vote down vote up
@EventHandler
public void serverLoad(FMLServerStartingEvent event) {
    instance = this;
    event.registerServerCommand(new RedGenCommand());
    event.registerServerCommand(new ClearCommand());
    event.registerServerCommand(new PosCommand());
    event.registerServerCommand(new Pos1Command());
    event.registerServerCommand(new Pos2Command());
    event.registerServerCommand(new RouteCommand());
    event.registerServerCommand(new MetaCommand());
    event.registerServerCommand(new CopyCommand());
    event.registerServerCommand(new PasteCommand());
    event.registerServerCommand(new UndoCommand());
    event.registerServerCommand(new RedoCommand());
    event.registerServerCommand(new MazeGenCommand());
}
 
Example 6
Project: ServerForge   File: ServerForge.java   View source code 6 votes vote down vote up
@Mod.EventHandler
public void serverStartingEvent(FMLServerStartingEvent e){
    info("Starting ServerForge...");
    this.serverStartingEvent = e;

    eventManager = new EventManager();
    eventManager.onServerStart();

    permissionsManager = new PermissionsManager();
    permissionsManager.onServerStart();

    pluginLoader = new PluginLoader();
    pluginLoader.onServerStart();

    this.serverStartingEvent = null;
    info("ServerForge started");
}
 
Example 7
Project: AdvHealthOptions   File: AdvHealthOptions.java   View source code 6 votes vote down vote up
@EventHandler
public void serverStarting(FMLServerStartingEvent event) {
	if (event.getServer().isDedicatedServer()) return;
	
	File worldConfigDir = new File(DimensionManager.getCurrentSaveRootDirectory(), "config");
	File worldConfigFile = new File(worldConfigDir, MOD_ID + ".cfg");
	
	worldConfig = new AHOWorldConfig(worldConfigFile);
	worldConfig.load(globalConfig);
	
	// If the world was just created using the	
	// create world screen, use the selected preset.
	EnumPreset preset = AHOGuiCreateWorld.getAndResetPreset();
	if (preset != EnumPreset.CUSTOM) {
		worldConfig.usePreset(preset);
		worldConfig.save();
	// Save the world config file if it's already created, in case the
	// preset setting was changed or the mod updated with new settings.
	} else if (worldConfigFile.exists())
		worldConfig.save();
	
	if (worldConfig.exists())
		config.add(Priority.WORLD, worldConfig);
}
 
Example 8
Project: MyTown2   File: MyTown.java   View source code 6 votes vote down vote up
@EventHandler
public void serverStarting(FMLServerStartingEvent ev) {
    EconomyProxy.init();
    checkConfig();
    registerCommands();
    Commands.populateCompletionMap();

    jsonConfigs.add(new WildPermsConfig(Constants.CONFIG_FOLDER + "/WildPerms.json"));
    jsonConfigs.add(new FlagsConfig(Constants.CONFIG_FOLDER + "/DefaultFlags.json"));
    jsonConfigs.add(new RanksConfig(Constants.CONFIG_FOLDER + "/DefaultTownRanks.json"));
    for (JsonConfig jsonConfig : jsonConfigs) {
        jsonConfig.init();
    }

    ProtectionParser.start();
    //SafemodeHandler.setSafemode(!DatasourceProxy.start(config));
    datasource = new MyTownDatasource();
    LOG.info("Started");
}
 
Example 9
Project: ShadowsOfPhysis   File: CommonProxy.java   View source code 6 votes vote down vote up
public void serverStarting(FMLServerStartingEvent event) { 
	RecipeHelper.parseRecipes();
	Physis.oooBuilder.start();

	if (FMLCommonHandler.instance().getEffectiveSide() == Side.SERVER) {
		World world = MinecraftServer.getServer().worldServers[0];
		PhysisWorldSavedData.load(world);
	}
	ServerData.reload(false);
	
	// set up the story!
	long seed = event.getServer().worldServers[0].getWorldInfo().getSeed();
	Random r = new Random(seed);
	long storySeed = Math.abs(r.nextLong());
	
	Physis.logger.info("Starting story engine: overworld seed: "+seed+", storyseed: "+storySeed);
	
	StoryEngine.reload(storySeed, false);
}
 
Example 10
Project: CreeperHostGui   File: CreeperHostServer.java   View source code 5 votes vote down vote up
@Mod.EventHandler
public void serverStarting(FMLServerStartingEvent event)
{
    event.registerServerCommand(new CommandInvite());
    event.registerServerCommand(new CommandPregen());
    deserializePreload(new File(getSaveFolder(), "pregenData.json"));
}
 
Example 11
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 12
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 13
Project: FTB-Islands   File: FTBIslands.java   View source code 5 votes vote down vote up
@Mod.EventHandler
public void serverLoading(FMLServerStartingEvent event) {
    logger.info("Registering commands.");
    event.registerServerCommand(new CreateIslandsCommand());
    event.registerServerCommand(new DeleteIslandCommand());
    event.registerServerCommand(new JoinIslandCommand());
    event.registerServerCommand(new ListIslandsCommand());
    event.registerServerCommand(new RenameIslandCommand());
    event.registerServerCommand(new SaveIslandsCommand());
    event.registerServerCommand(new SetIslandSpawnCommand());
    logger.info("Finished registering commands.");
    loadIslands();
    loadChestLoot();
}
 
Example 14
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 15
Project: Hammer-Mod   File: HammerMod.java   View source code 5 votes vote down vote up
@EventHandler
public void serverStart(FMLServerStartingEvent event)
{
     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());
     manager.registerCommand(new CommandAbilities());
}
 
Example 16
Project: BetterChat   File: BetterChat.java   View source code 5 votes vote down vote up
@Mod.EventHandler
public void serverStart(FMLServerStartingEvent e)
{
    MinecraftServer server = getServer();
    ICommandManager iCommandManager = server.getCommandManager();
    ServerCommandManager serverCommandManager = (ServerCommandManager)iCommandManager;

    serverCommandManager.registerCommand(new CommandHandler());
}
 
Example 17
Project: EEWReciever   File: ClientProxy.java   View source code 5 votes vote down vote up
@Override
public void serverLoad(final FMLServerStartingEvent event) {
	super.serverLoad(event);
	RootCommand.INSTANCE.addChildCommand(new CommandAuth());
	final Boolean bool = (Boolean) Launch.blackboard.get("fml.deobfuscatedEnvironment");
	if (bool)
		RootCommand.INSTANCE.addChildCommand(new CommandDebug());
}
 
Example 18
Project: Coreder   File: Coreder.java   View source code 5 votes vote down vote up
@SuppressWarnings("javadoc")
@EventHandler
public static final void addCommandsToServer(FMLServerStartingEvent evt) {
	echo("Loading server commands");
	for (CommandBase command : commands) {
		evt.registerServerCommand(command);
		debug("Command registered to server: " + command.getCommandName());
	}
}
 
Example 19
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 20
Project: PopularMMOS-EpicProportions-Mod   File: CommonProxy.java   View source code 5 votes vote down vote up
@EventHandler
public void serverLoad(FMLServerStartingEvent event)
{
    // register server commands

event.registerServerCommand(new CommandModInfo());
}
 
Example 21
Project: AntiMatterMod   File: AntiMatterModCore.java   View source code 5 votes vote down vote up
@Mod.EventHandler
@SuppressWarnings("unused")
public void serverStarting(FMLServerStartingEvent event) {
    event.registerServerCommand(new ExclusiveDeleteBlock());
    event.registerServerCommand(new Createsphere());
    
}
 
Example 22
Project: LimitedResources   File: CommonProxy.java   View source code 5 votes vote down vote up
public void serverInit( FMLServerStartingEvent event )
  {
if( Config.LimitedBlocks.isEnabled )
{
	event.registerServerCommand( new LimitedResourcesCommand( Config.Commands.shortAlias ) );
}
  }
 
Example 23
Project: Pathways   File: Proxy.java   View source code 5 votes vote down vote up
public void serverStarting(final FMLServerStartingEvent event) {
	if (ModOptions.getCommandTeleportEnable())
		event.registerServerCommand(new TeleportCommand());

	if (ModOptions.getCommandConfigureEnable())
		event.registerServerCommand(new ConfigureCommand());
}
 
Example 24
Project: LookingGlass   File: LookingGlass.java   View source code 5 votes vote down vote up
@EventHandler
public void serverStart(FMLServerStartingEvent event) {
	MinecraftServer mcserver = event.getServer();
	// Register commands
	((ServerCommandManager) mcserver.getCommandManager()).registerCommand(new CommandCreateView());
	// Start up the packet dispatcher we use for throttled data to client.
	ServerPacketDispatcher.getInstance().start(); //Note: This might need to be preceded by a force init of the ServerPacketDispatcher.  Doesn't seem to currently have any issues, though.
}
 
Example 25
Project: ModpackInfo   File: ModpackInfo.java   View source code 5 votes vote down vote up
@EventHandler
public void serverLoad(FMLServerStartingEvent event) {
	// Register our commands
	if (ModOptions.getEnableCommands()) {
		ModLog.info("Registering command handlers");
		CommandHelper.registerCommands(event);
	} else {
		ModLog.info("Not registering command handlers");
	}
}
 
Example 26
Project: JAM   File: JustAnotherMod.java   View source code 5 votes vote down vote up
@EventHandler
public void serverInit(FMLServerStartingEvent event){
	event.registerServerCommand(new PreGenCommand());
	if(ConfigChunkPreGen.x != null && ConfigChunkPreGen.z != null && ConfigChunkPreGen.height != null && ConfigChunkPreGen.width != null && ConfigChunkPreGen.height > 0 && ConfigChunkPreGen.width > 0) {
		ChunkGenUtils.generateChunks(ConfigChunkPreGen.x, ConfigChunkPreGen.z, ConfigChunkPreGen.width, ConfigChunkPreGen.height, 0);
	}
}
 
Example 27
Project: enhancedportals   File: NetworkManager.java   View source code 5 votes vote down vote up
public NetworkManager(FMLServerStartingEvent event) {
    server = event.getServer();

    portalCoords = new BidiMap<String, WorldPos>();
    portalNetwrks = new BidiArrayMap<String, String>();

    portalFile = new File(EnhancedPortals.proxy.getWorldDir(), "EP3_PortalLocations.json");
    networkFile = new File(EnhancedPortals.proxy.getWorldDir(), "EP3_PortalNetworks.json");

    try {
        loadAllData();
    } catch (Exception e) {
        EnhancedPortals.instance.getLogger().catching(e);
    }
}
 
Example 28
Project: Enterprise   File: PlanetguyLib.java   View source code 5 votes vote down vote up
@EventHandler
public void serverLoad(FMLServerStartingEvent evt) {
	Debug.mark();
	evt.registerServerCommand(new CommandEditBlacklist());
	if(FMLCommonHandler.instance().getEffectiveSide() == Side.CLIENT) {
		SafeDraw.init();
	}
}
 
Example 29
Project: bfsr   File: BFSR.java   View source code 5 votes vote down vote up
@EventHandler
public void serverLoad(FMLServerStartingEvent event) {
    ServerCommandManager manager = (ServerCommandManager) event.getServer().getCommandManager();
    manager.registerCommand(new BfsrSpawnCommand());
    manager.registerCommand(new BfsrGotoNurseryCommand());
    manager.registerCommand(new BfsrRegenTutorialDimension());
    manager.registerCommand(new BfsrTeleportCommand());
}
 
Example 30
Project: ChunkyPeripherals   File: ChunkyPeripherals.java   View source code 5 votes vote down vote up
@EventHandler
public void serverLoad(FMLServerStartingEvent event)
{
  event.registerServerCommand(new CRModListForgePersistentChunks());
  event.registerServerCommand(new CRModListLoadedChunks());
  event.registerServerCommand(new CRModToggleInfoLogging());
}
 
Example 31
Project: TickDynamic   File: TickDynamicMod.java   View source code 5 votes vote down vote up
@Subscribe
public void serverStart(FMLServerStartingEvent event) {
	event.registerServerCommand(new CommandHandler(this));
	
	tpsTimer.schedule(new TimerTickTask(this), 1000, 1000);
	versionCheckDone = false;
	versionChecker.runVersionCheck();
	
	
	server = event.getServer();
}
 
Example 32
Project: amunra   File: AmunRa.java   View source code 5 votes vote down vote up
@EventHandler
public void serverStarting(FMLServerStartingEvent event)
{
    event.registerServerCommand(new CommandShuttleTeleport());
    event.registerServerCommand(new CommandMoveMothership());
    event.registerServerCommand(new CommandMothershipInfo());
    event.registerServerCommand(new CommandMothershipForceArrive());
}
 
Example 33
Project: qcraft-mod   File: QCraft.java   View source code 5 votes vote down vote up
@Mod.EventHandler
public void serverLoad( FMLServerStartingEvent event )
{
    event.registerServerCommand( new QCraftCommand() );
    EncryptionSavedData.get(getDefWorld()); //trigger load of inter-server portal validations from disk to memory
    EntanglementSavedData.get(getDefWorld()); //trigger load of entanglements and portals from disk to memory
}
 
Example 34
Project: ClaimIO   File: Commands.java   View source code 5 votes vote down vote up
public static void RegisterCommands(FMLServerStartingEvent event) {
	event.registerServerCommand(new ClaimName());
	event.registerServerCommand(new TrustPlayer());
	event.registerServerCommand(new AbandonClaim());
	event.registerServerCommand(new ClaimList());
	event.registerServerCommand(new ListAllClaims());
}
 
Example 35
Project: EightInSeven   File: EightInSeven.java   View source code 5 votes vote down vote up
@SubscribeEvent
public void starting(FMLServerStartingEvent event) {
    if (visibilityRecalcService != null && !visibilityRecalcService.isShutdown())
        visibilityRecalcService.shutdown();

    visibilityRecalcService = Executors.newFixedThreadPool(6);
}
 
Example 36
Project: EE3Helper   File: EE3Help.java   View source code 5 votes vote down vote up
@EventHandler
public void serverLoad(FMLServerStartingEvent event) 
{
	if (!Loader.isModLoaded("EE3")) 
		return;

	event.registerServerCommand(new CommandEE3H());
}
 
Example 37
Project: GalacticGregGT5   File: GalacticGreg.java   View source code 5 votes vote down vote up
/**
 * If oregen profiling is enabled, then register the command
 * @param pEvent
 */
@EventHandler
public void serverLoad(FMLServerStartingEvent pEvent)
{
	Logger.trace("Entering SERVERLOAD");
	
	if (GalacticConfig.ProfileOreGen)
		pEvent.registerServerCommand(new ProfilingCommand());
	
	if (Loader.isModLoaded("appliedenergistics2") && GalacticConfig.EnableAEExportCommand && GalacticConfig.SchematicsEnabled)
		pEvent.registerServerCommand(new AEStorageCommand());
	
	Logger.trace("Leaving SERVERLOAD");
}
 
Example 38
Project: UsefulPets   File: UsefulPets.java   View source code 5 votes vote down vote up
@EventHandler
public void serverStarting( FMLServerStartingEvent event )
{
	MinecraftServer server = event.getServer();
	ISaveHandler save = server.worldServerForDimension( 0 ).getSaveHandler();
	
	petData.load( save.getMapFileFromName( "MEOW" ).getParentFile() );
}
 
Example 39
Project: fortressmod   File: FortressMod.java   View source code 5 votes vote down vote up
@EventHandler
public void serverStart(FMLServerStartingEvent event) {
     MinecraftServer server = MinecraftServer.getServer();
     
     ICommandManager command = server.getCommandManager();
     ServerCommandManager manager = (ServerCommandManager) command;
     StuckCommand stuckCommand = new StuckCommand();
     FMLCommonHandler.instance().bus().register(stuckCommand); //listen for ticks
     manager.registerCommand(stuckCommand);
}
 
Example 40
Project: ZeroQuest   File: ZeroQuest.java   View source code 5 votes vote down vote up
@EventHandler //TODO
public void serverStart(FMLServerStartingEvent event)        
{   
	Log.info("-----SERVER CONTENT LOAD INITATING-----");
	Log.info("Loading Commands...");     
    MinecraftServer server = MinecraftServer.getServer();
    ServerCommandManager cmdman = (ServerCommandManager) server.getCommandManager(); 
    cmdman.registerCommand(new CommandZeroQuest());
	Log.info("Commands Loaded Successfully!");  
	Log.info("-----SERVER CONTENT LOAD FINSHED-----");
	
}