    001    package cpw.mods.fml.common.event;
    002
    003    import net.minecraft.server.MinecraftServer;
    004    import net.minecraft.src.CommandHandler;
    005    import net.minecraft.src.ICommand;
    006    import cpw.mods.fml.common.LoaderState.ModState;
    007
    008    public class FMLServerStartingEvent extends FMLStateEvent
    009    {
    010
    011        private MinecraftServer server;
    012
    013        public FMLServerStartingEvent(Object... data)
    014        {
    015            super(data);
    016            this.server = (MinecraftServer) data[0];
    017        }
    018        @Override
    019        public ModState getModState()
    020        {
    021            return ModState.AVAILABLE;
    022        }
    023
    024        public MinecraftServer getServer()
    025        {
    026            return server;
    027        }
    028
    029        public void registerServerCommand(ICommand command)
    030        {
    031            CommandHandler ch = (CommandHandler) getServer().getCommandManager();
    032            ch.registerCommand(command);
    033        }
    034    }