當前位置: 首頁>>代碼示例>>Java>>正文


Java FMLServerStartingEvent類代碼示例

本文整理匯總了Java中cpw.mods.fml.common.event.FMLServerStartingEvent的典型用法代碼示例。如果您正苦於以下問題:Java FMLServerStartingEvent類的具體用法?Java FMLServerStartingEvent怎麽用?Java FMLServerStartingEvent使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


FMLServerStartingEvent類屬於cpw.mods.fml.common.event包,在下文中一共展示了FMLServerStartingEvent類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: serverStart

import cpw.mods.fml.common.event.FMLServerStartingEvent; //導入依賴的package包/類
@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();
}
 
開發者ID:RoyCurtis,項目名稱:WorldBorder-Forge,代碼行數:26,代碼來源:WorldBorder.java

示例2: serverStarting

import cpw.mods.fml.common.event.FMLServerStartingEvent; //導入依賴的package包/類
@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());
}
 
開發者ID:Microsoft,項目名稱:vsminecraft,代碼行數:21,代碼來源:Mekanism.java

示例3: serverLoad

import cpw.mods.fml.common.event.FMLServerStartingEvent; //導入依賴的package包/類
@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());
      
  }
 
開發者ID:h2r,項目名稱:burlapcraft,代碼行數:22,代碼來源:BurlapCraft.java

示例4: eventHandler

import cpw.mods.fml.common.event.FMLServerStartingEvent; //導入依賴的package包/類
@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();
}
 
開發者ID:DoubleDoorDevelopment,項目名稱:CrayCrafting,代碼行數:25,代碼來源:CrayCrafting.java

示例5: serverLoad

import cpw.mods.fml.common.event.FMLServerStartingEvent; //導入依賴的package包/類
@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());
}
 
開發者ID:kkroening,項目名稱:RedGen,代碼行數:17,代碼來源:RedGen.java

示例6: serverStartingEvent

import cpw.mods.fml.common.event.FMLServerStartingEvent; //導入依賴的package包/類
@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");
}
 
開發者ID:john01dav,項目名稱:ServerForge,代碼行數:18,代碼來源:ServerForge.java

示例7: serverStarting

import cpw.mods.fml.common.event.FMLServerStartingEvent; //導入依賴的package包/類
@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);
}
 
開發者ID:copygirl,項目名稱:AdvHealthOptions,代碼行數:25,代碼來源:AdvHealthOptions.java

示例8: serverStarting

import cpw.mods.fml.common.event.FMLServerStartingEvent; //導入依賴的package包/類
@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");
}
 
開發者ID:MyEssentials,項目名稱:MyTown2,代碼行數:20,代碼來源:MyTown.java

示例9: serverStarting

import cpw.mods.fml.common.event.FMLServerStartingEvent; //導入依賴的package包/類
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);
}
 
開發者ID:TTFTCUTS,項目名稱:ShadowsOfPhysis,代碼行數:20,代碼來源:CommonProxy.java

示例10: serverStarting

import cpw.mods.fml.common.event.FMLServerStartingEvent; //導入依賴的package包/類
@Mod.EventHandler
public void serverStarting(FMLServerStartingEvent event)
{
    event.registerServerCommand(new CommandInvite());
    event.registerServerCommand(new CommandPregen());
    deserializePreload(new File(getSaveFolder(), "pregenData.json"));
}
 
開發者ID:CreeperHost,項目名稱:CreeperHostGui,代碼行數:8,代碼來源:CreeperHostServer.java

示例11: serverStarting

import cpw.mods.fml.common.event.FMLServerStartingEvent; //導入依賴的package包/類
@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();
}
 
開發者ID:4Space,項目名稱:4Space-5,代碼行數:32,代碼來源:GalacticraftCore.java

示例12: Command

import cpw.mods.fml.common.event.FMLServerStartingEvent; //導入依賴的package包/類
@EventHandler
public void 		serverLoad(FMLServerStartingEvent event)
{
event.registerServerCommand(new Command());
  MinecraftForge.EVENT_BUS.register(new ForgeEventHooksHandler());
	CommandLoader.load(event);
}
 
開發者ID:GhostMonk3408,項目名稱:MidgarCrusade,代碼行數:8,代碼來源:Main.java

示例13: serverLoading

import cpw.mods.fml.common.event.FMLServerStartingEvent; //導入依賴的package包/類
@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();
}
 
開發者ID:Kolatra,項目名稱:FTB-Islands,代碼行數:15,代碼來源:FTBIslands.java

示例14: serverStarting

import cpw.mods.fml.common.event.FMLServerStartingEvent; //導入依賴的package包/類
@EventHandler
public void serverStarting(FMLServerStartingEvent event)
{
	ICommandManager commandManager = MinecraftServer.getServer().getCommandManager();
	ServerCommandManager serverCommandManager = ((ServerCommandManager) commandManager);
	addCommands(serverCommandManager);
}
 
開發者ID:rodolphito,項目名稱:Rival-Rebels-Mod,代碼行數:8,代碼來源:RivalRebels.java

示例15: serverStart

import cpw.mods.fml.common.event.FMLServerStartingEvent; //導入依賴的package包/類
@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());
}
 
開發者ID:jtrent238,項目名稱:Hammer-Mod,代碼行數:14,代碼來源:HammerMod.java


注:本文中的cpw.mods.fml.common.event.FMLServerStartingEvent類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。