当前位置: 首页>>代码示例>>Java>>正文


Java LauncherDirectories类代码示例

本文整理汇总了Java中net.technicpack.launchercore.install.LauncherDirectories的典型用法代码示例。如果您正苦于以下问题:Java LauncherDirectories类的具体用法?Java LauncherDirectories怎么用?Java LauncherDirectories使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


LauncherDirectories类属于net.technicpack.launchercore.install包,在下文中一共展示了LauncherDirectories类的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: ResourceLoader

import net.technicpack.launchercore.install.LauncherDirectories; //导入依赖的package包/类
public ResourceLoader(LauncherDirectories directories, String... resourcesPath) {
    if (directories == null)
        this.launcherAssets = null;
    else
        this.launcherAssets = new File(directories.getAssetsDirectory(), "launcher");
    dottedResourcePath = "";
    slashResourcePath = "";

    for (String pathToken : resourcesPath) {
        dottedResourcePath += pathToken + ".";
        slashResourcePath += "/" + pathToken;
    }

    Locale defaultLocale = Locale.getDefault();
    this.defaultLocale = matchClosestSupportedLocale(defaultLocale);

    if(!this.defaultLocale.getLanguage().equals(defaultLocale.getLanguage()))
        isDefaultLocaleSupported = false;
}
 
开发者ID:TechnicPack,项目名称:LauncherUICore,代码行数:20,代码来源:ResourceLoader.java

示例2: HandleVersionFileTask

import net.technicpack.launchercore.install.LauncherDirectories; //导入依赖的package包/类
public HandleVersionFileTask(ModpackModel pack, LauncherDirectories directories, ITasksQueue checkNonMavenLibsQueue, ITasksQueue checkLibraryQueue, ITasksQueue downloadLibraryQueue, ITasksQueue copyLibraryQueue, MojangVersionBuilder versionBuilder) {
    this.pack = pack;
    this.directories = directories;
    this.checkLibraryQueue = checkLibraryQueue;
    this.downloadLibraryQueue = downloadLibraryQueue;
    this.copyLibraryQueue = copyLibraryQueue;
    this.checkNonMavenLibsQueue = checkNonMavenLibsQueue;
    this.versionBuilder = versionBuilder;
    this.mavenConnector = new MavenConnector(directories, "forge", "http://files.minecraftforge.net/maven/");
}
 
开发者ID:TechnicPack,项目名称:MinecraftCore,代码行数:11,代码来源:HandleVersionFileTask.java

示例3: InstallVersionLibTask

import net.technicpack.launchercore.install.LauncherDirectories; //导入依赖的package包/类
public InstallVersionLibTask(Library library, MavenConnector mavenConnector, ITasksQueue grabQueue, ITasksQueue downloadLibraryQueue, ITasksQueue copyLibraryQueue, ModpackModel pack, LauncherDirectories directories) {
    this.library = library;
    this.mavenConnector = mavenConnector;
    this.downloadLibraryQueue = downloadLibraryQueue;
    this.copyLibraryQueue = copyLibraryQueue;
    this.grabQueue = grabQueue;
    this.pack = pack;
    this.directories = directories;
}
 
开发者ID:TechnicPack,项目名称:MinecraftCore,代码行数:10,代码来源:InstallVersionLibTask.java

示例4: Installer

import net.technicpack.launchercore.install.LauncherDirectories; //导入依赖的package包/类
public Installer(StartupParameters startupParameters, MirrorStore mirrorStore, LauncherDirectories directories, ModpackInstaller installer, MinecraftLauncher launcher, TechnicSettings settings, PackResourceMapper packIconMapper) {
    this.installer = installer;
    this.launcher = launcher;
    this.settings = settings;
    this.packIconMapper = packIconMapper;
    this.startupParameters = startupParameters;
    this.mirrorStore = mirrorStore;
    this.directories = directories;
}
 
开发者ID:TechnicPack,项目名称:LauncherV3,代码行数:10,代码来源:Installer.java

示例5: LauncherFrame

import net.technicpack.launchercore.install.LauncherDirectories; //导入依赖的package包/类
public LauncherFrame(final ResourceLoader resources, final ImageRepository<IUserType> skinRepository, final UserModel userModel, final TechnicSettings settings, final ModpackSelector modpackSelector, final ImageRepository<ModpackModel> iconRepo, final ImageRepository<ModpackModel> logoRepo, final ImageRepository<ModpackModel> backgroundRepo, final Installer installer, final ImageRepository<AuthorshipInfo> avatarRepo, final IPlatformApi platformApi, final LauncherDirectories directories, final IInstalledPackRepository packRepository, final StartupParameters params, final DiscoverInfoPanel discoverInfoPanel, final JavaVersionRepository javaVersions, final FileJavaSource fileJavaSource, final IBuildNumber buildNumber, final IDiscordApi discordApi) {
    setSize(FRAME_WIDTH, FRAME_HEIGHT);
    setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);
    setTitle("Technic Launcher");

    this.userModel = userModel;
    this.skinRepository = skinRepository;
    this.settings = settings;
    this.modpackSelector = modpackSelector;
    this.iconRepo = iconRepo;
    this.logoRepo = logoRepo;
    this.backgroundRepo = backgroundRepo;
    this.installer = installer;
    this.avatarRepo = avatarRepo;
    this.platformApi = platformApi;
    this.directories = directories;
    this.packRepo = packRepository;
    this.params = params;
    this.discoverInfoPanel = discoverInfoPanel;
    this.fileJavaSource = fileJavaSource;
    this.javaVersions = javaVersions;
    this.buildNumber = buildNumber;
    this.discordApi = discordApi;

    //Handles rebuilding the frame, so use it to build the frame in the first place
    relocalize(resources);

    selectTab("discover");

    EventQueue.invokeLater(new Runnable() {
        @Override
        public void run() {
            LauncherMain.consoleFrame.setVisible(settings.getShowConsole());
        }
    });

    setLocationRelativeTo(null);
}
 
开发者ID:TechnicPack,项目名称:LauncherV3,代码行数:39,代码来源:LauncherFrame.java

示例6: ModpackOptionsDialog

import net.technicpack.launchercore.install.LauncherDirectories; //导入依赖的package包/类
public ModpackOptionsDialog(Frame owner, LauncherDirectories directories, ModpackModel modpack, ResourceLoader resources) {
    super(owner);

    this.modpack = modpack;
    this.resources = resources;

    chooser = new JFileChooser(directories.getModpacksDirectory());
    chooser.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY);

    initComponents();
    initValues();
}
 
开发者ID:TechnicPack,项目名称:LauncherV3,代码行数:13,代码来源:ModpackOptionsDialog.java

示例7: TechnicRelauncher

import net.technicpack.launchercore.install.LauncherDirectories; //导入依赖的package包/类
public TechnicRelauncher(IUpdateStream updateStream, String stream, int currentBuild, LauncherDirectories directories, ResourceLoader resources, StartupParameters parameters) {
    super(stream, currentBuild, directories);

    this.resources = resources;
    this.parameters = parameters;
    this.updateStream = updateStream;
}
 
开发者ID:TechnicPack,项目名称:LauncherV3,代码行数:8,代码来源:TechnicRelauncher.java

示例8: migrate

import net.technicpack.launchercore.install.LauncherDirectories; //导入依赖的package包/类
@Override
public void migrate(TechnicSettings settings, IInstalledPackRepository packStore, LauncherDirectories directories, IUserStore<MojangUser> users) {
    //A fresh install/upgrade from v2 shouldn't show the latest news as being new
    int maxNewsId = 0;

    try {
        for (NewsArticle article : platformApi.getNews().getArticles()) {
            int newsId = article.getId();

            if (newsId > maxNewsId)
                maxNewsId = newsId;
        }

        settings.setLatestNewsArticle(maxNewsId);
    } catch (RestfulAPIException ex) {
        //Just kill the exception & go with ID 0
    }

    List<ModpackModel> deletePacks = new LinkedList<ModpackModel>();
    for (String packName : packStore.getPackNames()) {
        InstalledPack pack = packStore.getInstalledPacks().get(packName);
        ModpackModel model = new ModpackModel(pack, null, packStore, directories);

        if (!model.getInstalledDirectory().exists()) {
            deletePacks.add(model);
        }
    }

    for (ModpackModel deletePack : deletePacks) {
        deletePack.delete();
    }

    packStore.save();
}
 
开发者ID:TechnicPack,项目名称:LauncherV3,代码行数:35,代码来源:InitialV3Migrator.java

示例9: migrateSettings

import net.technicpack.launchercore.install.LauncherDirectories; //导入依赖的package包/类
public static void migrateSettings(TechnicSettings settings, IInstalledPackRepository packStore, LauncherDirectories directories, IUserStore<MojangUser> users, List<IMigrator> migrators) {
    for(IMigrator migrator : migrators) {
        String version = settings.getLauncherSettingsVersion();
        boolean bothNull = version == null && migrator.getMigrationVersion() == null;
        if (bothNull || (version != null && version.equals(migrator.getMigrationVersion())))  {
            migrator.migrate(settings, packStore, directories, users);
            settings.setLauncherSettingsVersion(migrator.getMigratedVersion());
        }
    }

    settings.save();
}
 
开发者ID:TechnicPack,项目名称:LauncherV3,代码行数:13,代码来源:SettingsFactory.java

示例10: MinecraftLauncher

import net.technicpack.launchercore.install.LauncherDirectories; //导入依赖的package包/类
public MinecraftLauncher(final IPlatformApi platformApi, final LauncherDirectories directories, final UserModel userModel, final JavaVersionRepository javaVersions) {
    this.directories = directories;
    this.platformApi = platformApi;
    this.userModel = userModel;
    this.javaVersions = javaVersions;
}
 
开发者ID:TechnicPack,项目名称:MinecraftCore,代码行数:7,代码来源:MinecraftLauncher.java

示例11: setupLogging

import net.technicpack.launchercore.install.LauncherDirectories; //导入依赖的package包/类
private static void setupLogging(LauncherDirectories directories, ResourceLoader resources, IBuildNumber buildNumber) {
        System.out.println("Setting up logging");
        final Logger logger = Utils.getLogger();
        File logDirectory = new File(directories.getLauncherDirectory(), "logs");
        if (!logDirectory.exists()) {
            logDirectory.mkdir();
        }
        File logs = new File(logDirectory, "techniclauncher_%D.log");
        RotatingFileHandler fileHandler = new RotatingFileHandler(logs.getPath());

        fileHandler.setFormatter(new BuildLogFormatter(buildNumber.getBuildNumber()));

        for (Handler h : logger.getHandlers()) {
            logger.removeHandler(h);
        }
        logger.addHandler(fileHandler);
        logger.setUseParentHandlers(false);

        LauncherMain.consoleFrame = new ConsoleFrame(2500, resources.getImage("icon.png"));
        Console console = new Console(LauncherMain.consoleFrame, buildNumber.getBuildNumber());

        logger.addHandler(new ConsoleHandler(console));

        System.setOut(new PrintStream(new LoggerOutputStream(console, Level.INFO, logger), true));
        System.setErr(new PrintStream(new LoggerOutputStream(console, Level.SEVERE, logger), true));

        Thread.setDefaultUncaughtExceptionHandler(new Thread.UncaughtExceptionHandler() {
            @Override
            public void uncaughtException(Thread t, Throwable e) {
                e.printStackTrace();
                logger.log(Level.SEVERE, "Unhandled Exception in " + t, e);

//                if (errorDialog == null) {
//                    LauncherFrame frame = null;
//
//                    try {
//                        frame = Launcher.getFrame();
//                    } catch (Exception ex) {
//                        //This can happen if we have a very early crash- before Launcher initializes
//                    }
//
//                    errorDialog = new ErrorDialog(frame, e);
//                    errorDialog.setVisible(true);
//                }
            }
        });
    }
 
开发者ID:TechnicPack,项目名称:LauncherV3,代码行数:48,代码来源:LauncherMain.java

示例12: TechnicAvatarMapper

import net.technicpack.launchercore.install.LauncherDirectories; //导入依赖的package包/类
public TechnicAvatarMapper(LauncherDirectories directories, ResourceLoader resources) {
    this.directories = directories;
    defaultImage = resources.getImage("icon.png");
}
 
开发者ID:TechnicPack,项目名称:LauncherV3,代码行数:5,代码来源:TechnicAvatarMapper.java

示例13: TechnicFaceMapper

import net.technicpack.launchercore.install.LauncherDirectories; //导入依赖的package包/类
public TechnicFaceMapper(LauncherDirectories directories, ResourceLoader resources) {
    this.directories = directories;
    defaultImage = resources.getImage("news/authorHelm.png");
}
 
开发者ID:TechnicPack,项目名称:LauncherV3,代码行数:5,代码来源:TechnicFaceMapper.java

示例14: migrate

import net.technicpack.launchercore.install.LauncherDirectories; //导入依赖的package包/类
void migrate(TechnicSettings settings, IInstalledPackRepository packStore, LauncherDirectories directories, IUserStore<MojangUser> users); 
开发者ID:TechnicPack,项目名称:LauncherV3,代码行数:2,代码来源:IMigrator.java


注:本文中的net.technicpack.launchercore.install.LauncherDirectories类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。