Examples of AssetIndex


Examples of com.atlauncher.data.mojang.AssetIndex

        indexesFolder.mkdirs();
        virtualFolder.mkdirs();
        try {
            new Downloadable(MojangConstants.DOWNLOAD_BASE.getURL("indexes/" + assetVersion + ".json"), indexFile,
                    null, this, false).download(false);
            AssetIndex index = (AssetIndex) this.gson.fromJson(new FileReader(indexFile), AssetIndex.class);

            if (index.isVirtual()) {
                virtualRoot.mkdirs();
            }

            for (Map.Entry<String, AssetObject> entry : index.getObjects().entrySet()) {
                AssetObject object = entry.getValue();
                String filename = object.getHash().substring(0, 2) + "/" + object.getHash();
                File file = new File(objectsFolder, filename);
                File virtualFile = new File(virtualRoot, entry.getKey());
                if (object.needToDownload(file)) {
                    downloads.add(new Downloadable(MojangConstants.RESOURCES_BASE.getURL(filename), file,
                            object.getHash(), (int) object.getSize(), this, false, virtualFile, index.isVirtual()));
                } else {
                    if (index.isVirtual()) {
                        virtualFile.mkdirs();
                        Utils.copyFile(file, virtualFile, true);
                    }
                }
            }
View Full Code Here

Examples of net.feed_the_beast.launcher.json.assets.AssetIndex

        return v;
    }

    public static AssetIndex loadAssetIndex (File json) throws JsonSyntaxException, JsonIOException, IOException {
        FileReader reader = new FileReader(json);
        AssetIndex a = GSON.fromJson(reader, AssetIndex.class);
        reader.close();
        return a;
    }
View Full Code Here

Examples of net.feed_the_beast.launcher.json.assets.AssetIndex

    }

    private static File syncAssets (File assetDir, String indexName) throws JsonSyntaxException, JsonIOException, IOException {
        Logger.logInfo("Syncing Assets:");
        final File objects = new File(assetDir, "objects");
        AssetIndex index = JsonFactory.loadAssetIndex(new File(assetDir, "indexes/{INDEX}.json".replace("{INDEX}", indexName)));

        if (!index.virtual) {
            return assetDir;
        }
View Full Code Here

Examples of net.feed_the_beast.launcher.json.assets.AssetIndex

            if (!json.exists()) {
                Logger.logError("asset JSON not found");
                return null;
            }

            AssetIndex index = JsonFactory.loadAssetIndex(json);

            Benchmark.start("threading");
            Collection<DownloadInfo> tmp;
            Logger.logDebug("Starting TaskHandler to check MC assets");
            Parallel.TaskHandler th = new Parallel.ForEach(index.objects.entrySet())
View Full Code Here

Examples of net.minecraftforge.gradle.json.version.AssetIndex

    }
   
    public static AssetIndex loadAssetsIndex(File json) throws JsonSyntaxException, JsonIOException, IOException
    {
        FileReader reader = new FileReader(json);
        AssetIndex a =  GSON.fromJson(reader, AssetIndex.class);
        reader.close();
        return a;
    }
View Full Code Here

Examples of net.minecraftforge.gradle.json.version.AssetIndex

    public void doTask() throws ParserConfigurationException, SAXException, IOException, InterruptedException
    {
        File out = new File(getAssetsDir(), "objects");
        out.mkdirs();

        AssetIndex index = getIndex();

        for (Entry<String, AssetEntry> e : index.objects.entrySet())
        {
            Asset asset = new Asset(e.getValue().hash, e.getValue().size);
            File file = new File(out, asset.path);
View Full Code Here

Examples of net.minecraftforge.gradle.json.version.AssetIndex

    @TaskAction
    public void doTask()
    {
        try
        {
            AssetIndex index = getAssetIndex();
            File assetsDir = new File(getAssetsDir(), "objects");
            File outputDir = getOutputDir();

            if (!index.virtual)
                return; // shrug
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.