Java 类net.minecraftforge.fml.common.event.FMLServerStartingEvent 实例源码

项目:World-Border    文件:WorldBorder.java   
@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();
}
项目:Toms-Mod    文件:CoreInit.java   
@EventHandler
public static void onServerStart(FMLServerStartingEvent event) {
    log.info("Server Start");
    proxy.serverStart();
    Transformers.injectNewFillCmd(event.getServer());
    if (isMapEnabled) {
        event.registerServerCommand(new CommandWaypoint(false));
        event.registerServerCommand(new CommandWaypoint(true));
        Minimap.init(new File(TomsModUtils.getSavedFile(), Reference.worldDirConfigName));
    }
    if (Config.enableResearchSystem)
        event.registerServerCommand(new CommandResearch());
    GlobalFields.EnderMemoryObj = new Object[][][][]{{new Object[65536][2]}, TomsModUtils.fillObject(65536)};
    if (isCCLoaded)
        GlobalFields.EnderMemoryIComputerAccess.clear();
    WorldHandler.onServerStart(new File(TomsModUtils.getSavedFile(), "chunkData"));
    PlayerHandler.onServerStart(new File(TomsModUtils.getSavedFile(), "playerData"));
    Config.printWarnings();
    log.info("Loading Completed");
}
项目:Progression    文件:Progression.java   
@EventHandler
public void onServerStarting(FMLServerStartingEvent event) {
    ICommandManager manager = event.getServer().getCommandManager();
    if (manager instanceof ServerCommandManager) {
        ((ServerCommandManager) manager).registerCommand(CommandManager.INSTANCE);
    }

    if (FMLCommonHandler.instance().getEffectiveSide() == Side.CLIENT) {
        Progression.logger.log(Level.INFO, "How did a client get in the server start?");
        return;
    }


    //Remap all relevant data, Loads in the server data
    RemappingHandler.reloadServerData(JSONLoader.getServerTabData(RemappingHandler.getHostName()), false);

    World world = FMLCommonHandler.instance().getMinecraftServerInstance().worldServers[0];
    data = (PlayerSavedData) world.loadItemData(PlayerSavedData.class, MODNAME);
    if (data == null) {
        createWorldData();
    }
}
项目:HCoreLib    文件:CommandHandler.java   
/**
 * Method for handling main registering call from FMLServerStartingEvent.
 *
 * @see FMLServerStartingEvent
 *
 * @param event FMLServerStartingEvent.
 */
public void registerCommands(FMLServerStartingEvent event) {
    timeLapse.resetStartTime();
    HCoreLibMain.logHelper.info("Registering commands...");

    if (event != null) {

        for (String commandName : commandMap.keySet()) {
            event.registerServerCommand(commandMap.get(commandName));
            HCoreLibMain.logHelper.info("Command:", commandName, "was registered!");
        }

        HCoreLibMain.logHelper.info("Finished registering commands successfully! (",
                timeLapse.getEffectiveTimeSince(), "ms ).");
    }

    else HCoreLibMain.logHelper.severe("Error registering commands... FMLServerStartingEvent is null!");

    regComplete = true;
}
项目:customgen    文件:Customgen.java   
@EventHandler
public void serverStart(FMLServerStartingEvent event){

    if(ForgeGenerator.getInstance() == null) {
        new ForgeGenerator();
    }

    /* when playing singleplayer this lets us update Gens by restarting the world
     * instead of restarting the game */
    GenManager genManager;
    //if(GenManager.getInstance() == null) {
        genManager = new GenManager();
    /*} else {
        genManager = GenManager.getInstance();
    }*/
       Gen[] gens = FileHandler.parseAllGens();
       if(gens != null) {
        for (int i = 0; i < gens.length; i++) {
            genManager.addGen(gens[i]);
        }
       }

}
项目:HardVox    文件:HardVox.java   
@EventHandler
public void serverStarting(FMLServerStartingEvent event) {
    Iterator<CommandModule> modules = Iterators.forArray(
            new RegionCommands(),
            new OperationCommands(),
            new SessionCommands());
    modules.forEachRemaining(m -> m.addCommands(event::registerServerCommand));
}
项目:minecraft-hue    文件:HueMod.java   
/**
 * Save the instance of the command manager and initialize the commands.
 *
 * @param event The server starting event that was fired.
 */
@EventHandler
public void serverStarting(FMLServerStartingEvent event) {
    MinecraftServer server = event.getServer();
    HueManager hueManager = HueManager.getInstance();
    hueManager.setMinecraftServer(server);
    this.listener.setWorld(server.getEntityWorld());
    this.commandManager = (ServerCommandManager) server.getCommandManager();
    this.initCommands();
}
项目:CreeperHostGui    文件:CreeperHostServer.java   
@Mod.EventHandler
public void serverStarting(FMLServerStartingEvent event)
{
    if (!CreeperHost.instance.active)
        return;
    event.registerServerCommand(new CommandInvite());
    event.registerServerCommand(new CommandPregen());
    deserializePreload(new File(getSaveFolder(), "pregenData.json"));
}
项目:craftsman    文件:Main.java   
@EventHandler
public void init(FMLServerStartingEvent event) {
    event.registerServerCommand(new Pyramid());
    event.registerServerCommand(new Stairs());
    event.registerServerCommand(new Maze());

    event.registerServerCommand(new Turtle());
    event.registerServerCommand(new Cube());
    event.registerServerCommand(new Frame());
    event.registerServerCommand(new Line());
    event.registerServerCommand(new Circle());
    event.registerServerCommand(new FillCircle());
    event.registerServerCommand(new Sphere());
    event.registerServerCommand(new Face());
}
项目:VanillaExtras    文件:ModCore.java   
@EventHandler
public void serverStarting(FMLServerStartingEvent event) {
    PacketHandler.NETWORKINSTANCE.registerMessage(PacketGetWorker.Handler.class, PacketGetWorker.class,
            PacketHandler.nextID(), Side.SERVER);
    PacketHandler.NETWORKINSTANCE.registerMessage(PacketReturnWorker.Handler.class, PacketReturnWorker.class,
            PacketHandler.nextID(), Side.CLIENT);
    event.registerServerCommand(new MainCmd());
    event.registerServerCommand(new GamemodeCmd());
}
项目:chunk-logger    文件:ChunkLogger.java   
@Mod.EventHandler
public void serverStart(FMLServerStartingEvent event) {
    event.registerServerCommand(new GetPlayersInChunk());
    event.registerServerCommand(new GetPlayersInChunks());
    if (Loader.isModLoaded("ftbu")) {
        event.registerServerCommand(new GetPlayersInClaimedChunks());
    }
}
项目:Teleporting-XP    文件:TeleportingXP.java   
@EventHandler
public void serverStarting(FMLServerStartingEvent event)
{
    World world = FMLCommonHandler.instance().getMinecraftServerInstance().getEntityWorld();

    world.getGameRules().setOrCreateGameRule("teleportXP", "false");
}
项目:minecraft-territorialdealings    文件:Main.java   
@EventHandler
  public void serverLoad(FMLServerStartingEvent event)
  {
this.worldFolder = event.getServer().getFolderName();   // Hand me that world name

SaveHandler.loadFactionsFromFile();
  }
项目:minecraft-territorialdealings    文件:Main.java   
@EventHandler
  public void serverLoad(FMLServerStartingEvent event)
  {
this.worldDir = event.getServer().getFolderName();  // Hand me that world name

_SaveData save = SaveHandler.loadFactionsFromFile(Main.configDir, Main.worldDir);

if (save == null)
{
    save = new _SaveData(); // Init
}

TerritoryHandler.setSaveData(save);
  }
项目:LittleThings-old    文件:CommonProxy.java   
public void serverStarting(FMLServerStartingEvent e)
{
    e.registerServerCommand(new CommandHead());
    e.registerServerCommand(new CommandSurvivalShortcut());
    e.registerServerCommand(new CommandCreativeShortcut());
    e.registerServerCommand(new CommandAdventureShortcut());
    e.registerServerCommand(new CommandSpectatorShortcut());
    e.registerServerCommand(new CommandSkull());
    e.registerServerCommand(new CommandDimTeleport());
}
项目:Simple-Dimensions    文件:SimpleDimensions.java   
@EventHandler
public void serverStarting(FMLServerStartingEvent event)
{
    event.registerServerCommand(new CommandSimpleDimensions());
    event.registerServerCommand(new CommandWeatherD());
    event.registerServerCommand(new CommandTimeD());
    event.registerServerCommand(new CommandTeleportD());

    DimensionHandler.getInstance().loadDimensions();
}
项目:wizards-of-lua    文件:WizardsOfLua.java   
@EventHandler
public void serverLoad(FMLServerStartingEvent event) {
  server = event.getServer();
  gameProfiles = new GameProfiles(server);
  event.registerServerCommand(new WolCommand());
  event.registerServerCommand(new LuaCommand());
  ChunkLoaderTicketSupport.enableTicketSupport(instance);
}
项目:metamorph    文件:Metamorph.java   
@EventHandler
public void serverStarting(FMLServerStartingEvent event)
{
    /* Setting up the blacklist */

    MorphManager.INSTANCE.setActiveBlacklist(MorphUtils.reloadBlacklist());
    MorphManager.INSTANCE.setActiveSettings(MorphUtils.reloadMorphSettings());

    /* Register commands */
    event.registerServerCommand(new CommandMorph());
    event.registerServerCommand(new CommandAcquireMorph());
    event.registerServerCommand(new CommandMetamorph());
}
项目:TombManyGraves    文件:ModCommands.java   
public static void initCommands(FMLServerStartingEvent event)
{
    event.registerServerCommand(new CommandFriend());
    event.registerServerCommand(new CommandFriendList());
    event.registerServerCommand(new CommandRemoveFriend());
    event.registerServerCommand(new CommandClearFriendList());
    event.registerServerCommand(new CommandRestoreInventory());
    event.registerServerCommand(new CommandDropInventory());
    event.registerServerCommand(new CommandGetDeathList());
    event.registerServerCommand(new CommandLoot());
}
项目:TombManyGraves-NOT-FOR-1.9.4-    文件:ModCommands.java   
public static void initCommands(FMLServerStartingEvent event)
{
    event.registerServerCommand(new CommandFriend());
    event.registerServerCommand(new CommandFriendList());
    event.registerServerCommand(new CommandRemoveFriend());
    event.registerServerCommand(new CommandClearFriendList());
    event.registerServerCommand(new CommandRestoreInventory());
    event.registerServerCommand(new CommandDropInventory());
}
项目:ShearMadness    文件:ShearMadnessMod.java   
@EventHandler
public void onServerStarting(FMLServerStartingEvent event) {
    List<CommandBase> childCommands = Lists.newArrayList();

    MinecraftForge.EVENT_BUS.post(new RegisterShearMadnessCommandEvent(childCommands));

    event.registerServerCommand(new ShearMadnessCommand(childCommands));
}
项目:Gravestone-mod-Extended    文件:ExtendedCommands.java   
public static ExtendedCommands getInstance(FMLServerStartingEvent event) {
    if (instance == null) {
        return new ExtendedCommands(event);
    } else {
        return instance;
    }
}
项目:ExtraTweaker    文件:ExtraTweaker.java   
@EventHandler
public void onServerStart(FMLServerStartingEvent event) {
    registerCommands(event.getServer());
    if (mtAvailable) {
        registerLoggers();
    }
}
项目:DexUtils    文件:DexUtils.java   
@EventHandler
public void serverLoad(FMLServerStartingEvent event) {
    waypointDB = new MexDB(DimensionManager.getCurrentSaveRootDirectory()
            .getPath() + File.separator + Reference.MODID, "waypoint");
    waypointDB.autopush(true);

    //event.registerServerCommand(new HomeCommand("dex", "'setspawn', "));
    event.registerServerCommand(new HomeCommand("home", "'set <name>', 'del <name>'"));
    event.registerServerCommand(new HomeCommand("spawn", "<world>"));
}
项目:blockbuster    文件:Blockbuster.java   
@EventHandler
public void serverStarting(FMLServerStartingEvent event)
{
    String path = DimensionManager.getCurrentSaveRootDirectory() + "/blockbuster/models";

    proxy.models.pack = proxy.getPack();
    proxy.models.pack.addFolder(path);
    proxy.loadModels(proxy.models.pack);

    event.registerServerCommand(new CommandAction());
    event.registerServerCommand(new CommandDirector());
    event.registerServerCommand(new CommandRecord());
    event.registerServerCommand(new CommandRecordSound());
}
项目:MobHunter    文件:MobHunter.java   
@Mod.EventHandler
public void serverStarting(FMLServerStartingEvent event)
{
    //Register commands
    event.registerServerCommand(new CommandQuest());
    event.registerServerCommand(new CommandHunterRank());
    event.registerServerCommand(new CommandMonsters());
}
项目:TFICore    文件:TFICommands.java   
public static void init(FMLServerStartingEvent event) {
    LogHelper.finfo("Adding Commands");
    //Can be disabled
    if(Configs.rainVoting){event.registerServerCommand(new CommandRainVote());}

    //Can't be disabled
    event.registerServerCommand(new CommandWorldInfo());
}
项目:TMT-Refraction    文件:CommonProxy.java   
public void serverStarting(FMLServerStartingEvent event) {
    String clname = Utils.HANDLER.getClass().getName();
    String expect = RefractionInternalHandler.class.getName();
    if (!clname.equals(expect)) {
        new IllegalAccessError("The Refraction API internal method handler has been overriden. "
                + "This will cause the intended behavior of Refraction to be different than expected. "
                + "It's marked \"Do not Override\", anyway. Whoever the hell overrode it needs to go "
                + " back to primary school and learn to read. (Expected classname: " + expect + ", Actual classname: " + clname + ")").printStackTrace();
        FMLCommonHandler.instance().exitJava(1, true);
    }
}
项目:EnderPay    文件:EnderPay.java   
@Mod.EventHandler
@SuppressWarnings("unused")
public void onServerStart(FMLServerStartingEvent event) {
    Account.clear();

    minecraftServer = event.getServer();
    File file = getWorldDir(minecraftServer.getEntityWorld());
    if (file == null) return;

    Account.setLocation(new File(file, "EnderPay-accounts"));

    registerCommands(event);
}
项目:EnderPay    文件:EnderPay.java   
private void registerCommands(FMLServerStartingEvent event) {
    MinecraftServer server = event.getServer();
    ICommandManager command = server.getCommandManager();
    ServerCommandManager manager = (ServerCommandManager) command;
    manager.registerCommand(new CommandWallet());
    manager.registerCommand(new CommandBalance());
    manager.registerCommand(new CommandPay());
}
项目:Factorization    文件:DocumentationModule.java   
@Mod.EventHandler
public void serverStarts(FMLServerStartingEvent event) {
    if (FMLCommonHandler.instance().getSide() == Side.CLIENT) {
        if (Core.dev_environ || Boolean.getBoolean("fz.registerDocCommands")) {
            event.registerServerCommand(new FzdocSerialize());
            event.registerServerCommand(new ExportHtml());
        }
    }
}
项目:TaleCraft    文件:TaleCraft.java   
@Mod.EventHandler
public void serverStarting(FMLServerStartingEvent event){
    MinecraftServer server = event.getServer();

    ICommandManager cmdmng = server.getCommandManager();
    if (cmdmng instanceof ServerCommandManager && cmdmng instanceof CommandHandler) {
        CommandHandler cmdhnd = (CommandHandler) cmdmng;
        TaleCraftCommands.register(cmdhnd);
    }

    // By calling this method, we create the ServerMirror for the given server.
    ServerHandler.getServerMirror(server);
}
项目:vintagetg    文件:VintageTG.java   
@EventHandler
public void onServerStart(FMLServerStartingEvent evt) {
    MinecraftServer server = MinecraftServer.getServer();
    ICommandManager command = server.getCommandManager();
    ServerCommandManager manager = (ServerCommandManager) command;
    manager.registerCommand(new VintageCraftCommands());
}
项目:UniversalCoins    文件:UniversalCoins.java   
@EventHandler
public void serverStart(FMLServerStartingEvent event) {
    ICommandManager command = event.getServer().getCommandManager();
    ServerCommandManager manager = (ServerCommandManager) command;
    manager.registerCommand(new UCCommand());
    manager.registerCommand(new UCBalance());
    manager.registerCommand(new UCRebalance());
    manager.registerCommand(new UCGive());
    manager.registerCommand(new UCSend());
}
项目:morecommands    文件:CommonProxy.java   
/**
 * Called from the main mod class to handle the server start
 */
protected void serverInit(FMLServerStartingEvent event) {
    this.handler.onStateEvent(event);

    try {
        this.registerServerCommands(event.getServer());
        this.mod.getLogger().info("Server Commands successfully registered");
    }
    catch (Exception ex) {this.mod.getLogger().warn("Failed to register Server Command", ex);}

    if (MoreCommandsConfig.retryHandshake)
        PacketHandlerServer.startHandshakeRetryThread();
}
项目:Kingdom-Keys-Re-Coded    文件:KingdomKeys.java   
@EventHandler
public void serverStart (FMLServerStartingEvent e) {
    e.registerServerCommand(new CommandLearnRecipe());
    e.registerServerCommand(new CommandGiveMunny());
    e.registerServerCommand(new CommandCheatMode());
    e.registerServerCommand(new CommandRemoveKeychain());
    e.registerServerCommand(new CommandResetLevel());
    e.registerServerCommand(new CommandLevelUp());
    e.registerServerCommand(new CommandDriveLevel());
    e.registerServerCommand(new CommandShowHud());
    e.registerServerCommand(new CommandDimension());
    e.registerServerCommand(new CommandOpenKeychains());

    logger.info("Commands loaded");
}
项目:MoreDimensions    文件:MoreDimensions.java   
@EventHandler
public void serverLoad(FMLServerStartingEvent event)
{
    LapisWorld.serverLoad(event);
    LapisDimension.serverLoad(event);
    CoalWorld.serverLoad(event);
    CoalDimension.serverLoad(event);
    RedstoneWorld.serverLoad(event);
    RedstoneDimension.serverLoad(event);
    IronWorld.serverLoad(event);
    IronDimension.serverLoad(event);
    GoldWorld.serverLoad(event);
    GoldDimension.serverLoad(event);
    EmeraldWorld.serverLoad(event);
    EmeraldDimension.serverLoad(event);
    DiamondWorld.serverLoad(event);
    DiamondDimension.serverLoad(event);
    WoodWorld.serverLoad(event);
    WoodDimension.serverLoad(event);
    VoidWorld.serverLoad(event);
    VoidDimension.serverLoad(event);
    SnowWorld.serverLoad(event);
    SnowDimension.serverLoad(event);
    QuartzWorld.serverLoad(event);
    QuartzDimension.serverLoad(event);
    GlassWorld.serverLoad(event);
    GlassDimension.serverLoad(event);
    ObsidianWorld.serverLoad(event);
    LapisIgniter.serverLoad(event);
    CoalIgniter.serverLoad(event);
    RedstoneIgniter.serverLoad(event);
    IronIgniter.serverLoad(event);
    GoldIgniter.serverLoad(event);
    DiamondIgniter.serverLoad(event);
    EmeraldIgniter.serverLoad(event);
    WoodIgniter.serverLoad(event);
    VoidIgniter.serverLoad(event);
    ObsidianDimension.serverLoad(event);
    ObsidianIgniter.serverLoad(event);
}
项目:Bookshelf    文件:Bookshelf.java   
@EventHandler
public void serverStarting (FMLServerStartingEvent event) {

    for (final ICommand command : BookshelfRegistry.getCommands()) {

        event.registerServerCommand(command);
    }
}
项目:Wars-Mod    文件:WarsMod.java   
@EventHandler
public void serverStart(FMLServerStartingEvent event) {
    MinecraftServer server = FMLCommonHandler.instance().getMinecraftServerInstance();
    ICommandManager command = server.getCommandManager();

    ServerCommandManager serverCommand = (ServerCommandManager) command;

    serverCommand.registerCommand(new CommandKills());
    serverCommand.registerCommand(new CommandShowKills());
    serverCommand.registerCommand(new CommandSetBase());
    serverCommand.registerCommand(new CommandEditMode());
}
项目:Skills    文件:Skillz.java   
@EventHandler
        public void serverStart(FMLServerStartingEvent event)
        {
            //MinecraftServer server = MinecraftServer.getServer();
            //ICommandManager command = server.getCommandManager();
            //ServerCommandManager manager = (ServerCommandManager) command;

//          manager.registerCommand(new CommandPhysics());

        }