Package net.ftb.data

Examples of net.ftb.data.TexturePack


        texturePacksScroll.revalidate();
    }

    @Override
    public void onTexturePackAdded (TexturePack texturePack) {
        final TexturePack texturePack_ = texturePack;
        SwingUtilities.invokeLater(new Runnable() {
            public void run () {
                addTexturePack(texturePack_);
                Logger.logInfo("Adding texture pack " + getTexturePackNum() + " (" + texturePack_.getName() + ")");
                updateTexturePacks();
            }
        });
    }
View Full Code Here


            }
            NodeList texturePacks = doc.getElementsByTagName("texturepack");
            for (int i = 0; i < texturePacks.getLength(); i++) {
                Node texturePack = texturePacks.item(i);
                NamedNodeMap textureAttr = texturePack.getAttributes();
                TexturePack.addTexturePack(new TexturePack(textureAttr.getNamedItem("name").getTextContent(), textureAttr.getNamedItem("author").getTextContent(), textureAttr.getNamedItem("version")
                        .getTextContent(), textureAttr.getNamedItem("url").getTextContent(), textureAttr.getNamedItem("logo").getTextContent(), textureAttr.getNamedItem("image").getTextContent(),
                        textureAttr.getNamedItem("mcversion").getTextContent(), textureAttr.getNamedItem("compatible").getTextContent(),
                        textureAttr.getNamedItem("description") == null ? null : textureAttr.getNamedItem("description").getTextContent().replace(
                                "\\n", "\n"),
                        textureAttr.getNamedItem("resolution").getTextContent(), i));
View Full Code Here

    private class TexturePackManagerWorker extends SwingWorker<Boolean, Void> {
        @Override
        protected Boolean doInBackground () throws Exception {
            String installPath = Settings.getSettings().getInstallPath();
            TexturePack texturePack = TexturePack.getSelectedTexturePack();
            String compDir = texturePack.getSelectedCompatible();
            ModPack compPack = ModPack.getPack(compDir);
            int mcversion = Integer.parseInt(compPack.getMcVersion().replace(".", ""));
            if (updating) {
                texturePack = updateTexture;
                compDir = updateModPack.getDir();
                compPack = updateModPack;
            }
            if (compPack == null) {
                ErrorUtils.tossError("Error: Invalid Mod Pack destination selected.");
                return false;
            }

            String packVer = (Settings.getSettings().getPackVer(compDir).equalsIgnoreCase("Recommended Version") ? compPack.getVersion() : Settings.getSettings().getPackVer(compDir))
                    .replace(".", "_");
            String packStr;
            if (mcversion > 160) {
                packStr = "";
            } else {
                packStr = "/" + packVer;
            }
            if (!compPack.hasCustomTP()
                    && DownloadUtils.fileExists(TEXTUREPACKS + texturePack.getName().replace(" ", "_") + "/" + "master_" + compPack.getMcVersion().replace(".", "_") + packStr + "/"
                    + texturePack.getUrl())) {
                populateInstalledTextures(compPack);
                File oldFile = new File(installPath, texturePack.getSelectedCompatible() + sep + "minecraft" + sep + getTPDirectory(mcversion) + sep + texturePack.getUrl());
                if (oldFile.exists()) {
                    oldFile.delete();
                }
                return downloadTexturePack(texturePack.getUrl(), texturePack.getName(), "master_" + compPack.getMcVersion().replace(".", "_"), compDir, packVer);
            } else if (DownloadUtils.fileExists(TEXTUREPACKS + texturePack.getName().replace(" ", "_") + "/" + compDir + packStr + "/" + texturePack.getUrl())) {
                populateInstalledTextures(compPack);
                File oldFile = new File(installPath, texturePack.getSelectedCompatible() + sep + "minecraft" + sep + getTPDirectory(mcversion) + sep + texturePack.getUrl());
                if (oldFile.exists()) {
                    oldFile.delete();
                }
                return downloadTexturePack(texturePack.getUrl(), texturePack.getName(), compDir, compDir, packVer);
            } else {
                ErrorUtils.tossError("Error: Texture Pack not found for selected mod pack's version!");
                return false;
            }
        }
View Full Code Here

TOP

Related Classes of net.ftb.data.TexturePack

Copyright © 2018 www.massapicom. 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.