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

The following examples show how to use cpw.mods.fml.common.event.FMLServerStartingEvent. These examples are extracted from open source projects. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may want to check out the right sidebar which shows the related API usage.
Example 1
/**
 * Do some stuff once the server starts
 *
 * @param pEvent
 */
@Mod.EventHandler
public void serverLoad(FMLServerStartingEvent pEvent)
{
    if (CoreConfig.ModHazardousItems_Enabled) {
        pEvent.registerServerCommand(new HazardousItemsCommand());
    }
    if (CoreConfig.ModCustomToolTips_Enabled) {
        pEvent.registerServerCommand(new CustomToolTipsCommand());
    }
    if (CoreConfig.ModItemInHandInfo_Enabled) {
        pEvent.registerServerCommand(new ItemInHandInfoCommand());
    }
    if (CoreConfig.ModCustomFuels_Enabled) {
        pEvent.registerServerCommand(new CustomFuelsCommand());
    }
    if (CoreConfig.ModCustomDrops_Enabled) {
        pEvent.registerServerCommand(new CustomDropsCommand());
    }
    if (YAMCore.isDebug()) {
        pEvent.registerServerCommand(new AllPurposeDebugCommand());
    }
}
 
Example 2
@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 3
Source Project: MyTown2   Source File: MyTown.java    License: The Unlicense 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 4
Source Project: bartworks   Source File: BartWorksCrossmod.java    License: MIT License 5 votes vote down vote up
@Mod.EventHandler
public void onFMLServerStart(FMLServerStartingEvent event) {
    if (LoaderReference.miscutils)
        for (Object s : RadioHatchCompat.TranslateSet){
            StringTranslate.inject(new ReaderInputStream(new StringReader((String) s)));
        }
}
 
Example 5
Source Project: bartworks   Source File: RegisterServerCommands.java    License: MIT License 5 votes vote down vote up
public static void registerAll(FMLServerStartingEvent event){
    event.registerServerCommand(new SummonRuin());
    event.registerServerCommand(new ChangeConfig());
    event.registerServerCommand(new PrintRecipeListToFile());
    event.registerServerCommand(new ClearCraftingCache());
    event.registerServerCommand(new GetWorkingDirectory());
    event.registerServerCommand(new RunGC());
}
 
Example 6
Source Project: LookingGlass   Source File: LookingGlass.java    License: GNU General Public License v3.0 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 7
Source Project: TickDynamic   Source File: TickDynamicMod.java    License: MIT License 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 8
Source Project: qcraft-mod   Source File: QCraft.java    License: Apache License 2.0 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 9
Source Project: NBTEdit   Source File: NBTEdit.java    License: GNU General Public License v3.0 5 votes vote down vote up
@EventHandler
public void serverStarting(FMLServerStartingEvent event) {
	MinecraftServer server= event.getServer();
	ServerCommandManager serverCommandManager = (ServerCommandManager) server.getCommandManager();
	serverCommandManager.registerCommand(new CommandNBTEdit());
	logger.fine("Server Starting -- Added \"/nbtedit\" command");
}
 
Example 10
Source Project: archimedes-ships   Source File: ArchimedesShipMod.java    License: MIT License 5 votes vote down vote up
@SuppressWarnings("unchecked")
@EventHandler
public void serverStarting(FMLServerStartingEvent event)
{
	registerASCommand(event, new CommandASHelp());
	registerASCommand(event, new CommandDisassembleShip());
	registerASCommand(event, new CommandShipInfo());
	registerASCommand(event, new CommandDisassembleNear());
	Collections.sort(CommandASHelp.asCommands);
}
 
Example 11
@Mod.EventHandler
public void serverStarting(FMLServerStartingEvent event) {
	Game.events().publish(new ServerEvent.Start());
}
 
Example 12
Source Project: FastAsyncWorldedit   Source File: ForgeMain.java    License: GNU General Public License v3.0 4 votes vote down vote up
@Mod.EventHandler
public void serverLoad(FMLServerStartingEvent event) {
    IMP.insertCommands();
}
 
Example 13
Source Project: Et-Futurum   Source File: EtFuturum.java    License: The Unlicense 4 votes vote down vote up
@EventHandler
public void serverStarting(FMLServerStartingEvent event) {
	if (EtFuturum.enablePlayerSkinOverlay)
		event.registerServerCommand(new SetPlayerModelCommand());
}
 
Example 14
Source Project: EnderStorage   Source File: EnderStorage.java    License: MIT License 4 votes vote down vote up
@EventHandler
public void serverStart(FMLServerStartingEvent event) {
    CommandHandler commandManager = (CommandHandler) event.getServer().getCommandManager();
    commandManager.registerCommand(new CommandEnderStorage());
}
 
Example 15
Source Project: ChickenChunks   Source File: ChunkLoaderProxy.java    License: MIT License 4 votes vote down vote up
public void registerCommands(FMLServerStartingEvent event)
{
    CommandHandler commandManager = (CommandHandler)event.getServer().getCommandManager();
    commandManager.registerCommand(new CommandChunkLoaders());
    commandManager.registerCommand(new CommandDebugInfo());
}
 
Example 16
Source Project: ChickenChunks   Source File: ChickenChunks.java    License: MIT License 4 votes vote down vote up
@EventHandler
public void serverStarting(FMLServerStartingEvent event) {
    proxy.registerCommands(event);
}
 
Example 17
Source Project: OmniOcular   Source File: OmniOcular.java    License: Apache License 2.0 4 votes vote down vote up
@Mod.EventHandler
    void onServerStart(FMLServerStartingEvent event) {
//        LogHelper.info("FMLServerStartingEvent");
        proxy.registerServerCommand(event);
    }
 
Example 18
Source Project: OmniOcular   Source File: CommonProxy.java    License: Apache License 2.0 4 votes vote down vote up
@Override
public void registerServerCommand(FMLServerStartingEvent event) {
    event.registerServerCommand(new CommandReloadConfig());
}
 
Example 19
Source Project: archimedes-ships   Source File: ArchimedesShipMod.java    License: MIT License 4 votes vote down vote up
private void registerASCommand(FMLServerStartingEvent event, CommandBase commandbase)
{
	event.registerServerCommand(commandbase);
	CommandASHelp.asCommands.add(commandbase);
}
 
Example 20
@EventHandler
public void onFMLServerStart(FMLServerStartingEvent event) {
    event.registerServerCommand(new CommandOutputs());
}
 
Example 21
Source Project: WirelessRedstone   Source File: WirelessRedstoneCore.java    License: MIT License 4 votes vote down vote up
@EventHandler
public void serverStarting(FMLServerStartingEvent event) {
    CommandHandler commandManager = (CommandHandler) event.getServer().getCommandManager();
    commandManager.registerCommand(new CommandFreq());
}
 
Example 22
Source Project: mocreaturesdev   Source File: MoCreatures.java    License: GNU General Public License v3.0 4 votes vote down vote up
@ServerStarting
public void serverStarting(FMLServerStartingEvent event)
{
    event.registerServerCommand(new CommandMoCreatures());
}
 
Example 23
@EventHandler
public void onServerStart(FMLServerStartingEvent event){
    ServerCommandManager comManager = (ServerCommandManager)MinecraftServer.getServer().getCommandManager();
    new PCCommandManager().init(comManager);
}
 
Example 24
Source Project: OpenPeripheral   Source File: OpenPeripheralCore.java    License: MIT License 4 votes vote down vote up
@EventHandler
public void severStart(FMLServerStartingEvent evt) {
	evt.registerServerCommand(new CommandDump("op_dump", evt.getServer().isDedicatedServer()));
}
 
Example 25
Source Project: OmniOcular   Source File: IProxy.java    License: Apache License 2.0 votes vote down vote up
void registerServerCommand(FMLServerStartingEvent event);