Package com.atlauncher.data

Examples of com.atlauncher.data.Mod


                return forge.getFile();
            } else {
                return "minecraft_server." + this.version.getMinecraftVersion().getVersion() + ".jar";
            }
        } else {
            Mod forge = null; // The Forge Mod
            Mod mcpc = null; // The MCPC Mod
            for (Mod mod : selectedMods) {
                if (mod.getType() == Type.forge) {
                    forge = mod;
                } else if (mod.getType() == Type.mcpc) {
                    mcpc = mod;
                }
            }
            if (mcpc != null) {
                return mcpc.getFile();
            } else if (forge != null) {
                return forge.getFile();
            } else {
                return "minecraft_server." + this.version.getMinecraftVersion().getVersion() + ".jar";
            }
View Full Code Here


        int count1 = 0;
        int count2 = 0;

        for (int i = 0; i < installer.getMods().size(); ) {
            boolean skip = false;
            final Mod mod = installer.getMods().get(i);
            if (installer.isServer() && !mod.installOnServer()) {
                continue;
            }
            ModsJCheckBox checkBox = null;
            if ((installer.isServer() ? mod.isServerOptional() : mod.isOptional())) {
                if (!mod.getCategory().isEmpty()) {
                    if (!categoriesDone.contains(mod.getCategory())) {
                        skip = true;
                        categoriesDone.add(mod.getCategory());
                        checkBox = new ModsJCheckBox(installerr.getCategoryName(mod.getCategory()));
                        checkBox.setBounds(0, (count1 * 20), checkBox.getPreferredSize().width, 20);
                        checkBox.setEnabled(false);
                        count1++;
                    }
                }
                if (!skip) {
                    checkBox = new ModsJCheckBox(mod);
                    checkBox.setEnabled(true);
                    if (mod.getLinked().isEmpty()) {
                        checkBox.setBounds((mod.hasCategory() ? 20 : 0), (count1 * 20),
                                checkBox.getPreferredSize().width, 20);
                    } else {
                        Mod linkedMod = installer.getModByName(mod.getLinked());
                        if (linkedMod == null) {
                            LogManager.error("The mod " + mod.getName() + " tried to reference a linked mod " + mod
                                    .getLinked() + " which doesn't exist!");
                            installer.cancel(true);
                            return;
                        }
                        if ((installer.isServer() ? linkedMod.isServerOptional() : linkedMod.isOptional())) {
                            checkBox.setEnabled(false);
                            checkBox.setBounds((mod.hasCategory() ? 40 : 20), (count1 * 20),
                                    checkBox.getPreferredSize().width, 20);
                        } else {
                            checkBox.setBounds((mod.hasCategory() ? 20 : 0), (count1 * 20),
                                    checkBox.getPreferredSize().width, 20);
                        }
                        if (mod.isSelected()) {
                            checkBox.setEnabled(true);
                            checkBox.setSelected(true);
                            if (!linkedMod.isSelected()) {
                                boolean needToEnableChildren = false;
                                for (ModsJCheckBox checkbox : modCheckboxes) {
                                    if (checkbox.getMod().getName().equalsIgnoreCase(mod.getLinked())) {
                                        checkbox.setSelected(true); // Select the checkbox
                                        needToEnableChildren = true;
                                        break;
                                    }
                                }
                                if (needToEnableChildren) {
                                    for (ModsJCheckBox checkbox : modCheckboxes) {
                                        if (checkbox.getMod().getLinked().equalsIgnoreCase(mod.getLinked())) {
                                            checkbox.setEnabled(true);
                                        }
                                    }
                                }
                            }
                        } else {
                            if (linkedMod.isSelected()) {
                                checkBox.setEnabled(true);
                            }
                        }
                    }
                    if (mod.isHidden() || mod.isLibrary()) {
View Full Code Here

TOP

Related Classes of com.atlauncher.data.Mod

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.