@Mod.EventHandler public void on(FMLServerAboutToStartEvent event) { getLogger().info("Initializing a new bukkit server"); MinecraftServer minecraftServer = event.getServer(); VolatileServer volatileServer; try { volatileServer = (VolatileServer)Bukkit.getServer(); Preconditions.checkNotNull(volatileServer); } catch (Exception e) { throw new IllegalStateException("Bukkit.getServer is NOT a VolatileServer!",e); } BukkitServer server = new BukkitServer(this, minecraftServer); volatileServer.setCurrentServer(server); server.start(); }
/** * This event will be fired before server start. * Only the ServerSide will receive this event. * * @param event */ public void OnServerAboutToStart(FMLServerAboutToStartEvent event) { /*!gen.mod.hook.OnServerAboutToStart*/ /**/ //TODO:Add your own code here }
/** * Called when the Minecraft server started. * * @param event * the event. */ @ServerAboutToStart public void serverAboutToStart(FMLServerAboutToStartEvent event) { try { Config.Server c = config.server; ServerConfig sc = new ServerConfig(c.address, c.externalAddress, c.port, c.behindFirewall, c.storageType, c.storage); ((IServer) P2P.get(P2P.SERVER_PROVIDER)).start(sc); } catch (Exception e) { FMLLog.log(MOD_ID, Level.SEVERE, e, "Can't start the server"); } }
@EventHandler public void onServerStart(FMLServerAboutToStartEvent event){ CommandHandler manager = (CommandHandler) event.getServer().getCommandManager(); manager.registerCommand(new VelocityCommand()); manager.registerCommand(new CTabCommand()); manager.registerCommand(new NotifyCommand()); manager.registerCommand(new WipeEntitiesCommand()); }
@EventHandler @SideOnly(Side.SERVER) public void serverAboutToStart(FMLServerAboutToStartEvent event) { ProgressDisplayer.close(); }
@Mod.EventHandler public void on(FMLServerAboutToStartEvent event) { mod.getLogger().info("###### ServerAboutToStartEvent ######"); }
@EventHandler public void onServerAboutToStart(FMLServerAboutToStartEvent event) { // PocketRegistry needs to be loaded before the TileEntities are read from NBT PocketRegistry.loadData(); }
@Mod.EventHandler public void serverPreStarting(FMLServerAboutToStartEvent event) { proxy.serverPreStarting(event); }
public void serverPreStarting(FMLServerAboutToStartEvent event) { //ServerData.reload(false); }
/** * A public method to handle the server-side pre-starting functionality.<p/> * From the {@link EventHandler} javadoc for methods using the {@link FMLServerAboutToStartEvent} parameter: * <pre> * FMLServerAboutToStartEvent: * Use if you need to handle something before the server has even been created. * </pre> * @param event A Forge event handler for when the server has not yet started. */ @EventHandler abstract public void serverStartBefore(FMLServerAboutToStartEvent event);
/** * Called when the server-about-to-start event occurs. * * *event* is the server-about-to-start event. */ public void serverAboutToStart(FMLServerAboutToStartEvent event);
/** * Send the server-about-to-start event to the python mod. * * *event* is the server-about-to-start event. */ public void serverAboutToStart(FMLServerAboutToStartEvent event) { this.log.fine("Server about to start."); this.pythonMod.serverAboutToStart(event); }