Package codechicken.lib.config

Examples of codechicken.lib.config.ConfigTag


        int i = getIntSetting("inventory.itemIDs");
        return i == 2 || (i == 1 && isEnabled() && !isHidden());
    }

    public static void toggleBooleanSetting(String setting) {
        ConfigTag tag = getSetting(setting);
        tag.setBooleanValue(!tag.getBooleanValue());
    }
View Full Code Here


        ConfigTag tag = getSetting(setting);
        tag.setBooleanValue(!tag.getBooleanValue());
    }

    public static void cycleSetting(String setting, int max) {
        ConfigTag tag = getSetting(setting);
        tag.setIntValue((tag.getIntValue() + 1) % max);
    }
View Full Code Here

    public void copyGlobal(String s, boolean recursive) {
        if (!worldConfig())
            return;

        ConfigTag tag = globalConfigSet().config.getTag(s);
        worldConfigSet().config.getTag(s).setValue(tag.getValue());
        if(recursive)
            for(String s2 : tag.childTagMap().keySet())
                copyGlobal(s+"."+s2);
    }
View Full Code Here

public class HUDRenderer implements IKeyStateTracker
{
    @Override
    public void tickKeyStates() {
        if (KeyManager.keyStates.get("world.highlight_tips").down) {
            ConfigTag tag = NEIClientConfig.getSetting("world.highlight_tips");
            tag.setBooleanValue(!tag.getBooleanValue());
        }
    }
View Full Code Here

            FMLCommonHandler.instance().bus().register(new CCCEventHandler());
        }
    }

    private void notificationCheck() {
        final ConfigTag tag = config.getTag("checkNotifications").setComment("The most recent notification number recieved. -1 to disable");
        final int notify = tag.getIntValue(0);
        if(notify < 0)
            return;

        CCUpdateChecker.updateCheck(
                "http://www.chickenbones.net/Files/notification/general.php",
                new Function<String, Void>()
                {
                    @Override
                    public Void apply(String ret) {
                        Matcher m = Pattern.compile("Ret \\((\\d+)\\): (.+)").matcher(ret);
                        if (!m.matches()) {
                            CodeChickenCorePlugin.logger.error("Failed to check notifications: " + ret);
                            return null;
                        }
                        int index = Integer.parseInt(m.group(1));
                        if(index > notify) {
                            tag.setIntValue(index);
                            CCUpdateChecker.addUpdateMessage(m.group(2));
                        }
                        return null;
                    }
                });
View Full Code Here

    }

    public static class MCPRemapper extends Remapper implements LineProcessor<Void>
    {
        public static File[] getConfFiles() {
            ConfigTag tag = ASMHelper.config.getTag("mappingDir").setComment("Path to directory holding packaged.srg, fields.csv and methods.csv for mcp remapping");
            for (int i = 0; i < DIR_GUESSES+DIR_ASKS; i++) {
                File dir = confDirectoryGuess(i, tag);
                if (dir == null || dir.isFile())
                    continue;

                File[] mappings;
                try {
                    mappings = parseConfDir(dir);
                } catch (Exception e) {
                    if (i >= DIR_GUESSES)
                        e.printStackTrace();
                    continue;
                }

                tag.setValue(dir.getPath());
                return mappings;
            }

            throw new RuntimeException("Failed to select mappings directory, set it manually in the config");
        }
View Full Code Here

TOP

Related Classes of codechicken.lib.config.ConfigTag

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.