Package net.minecraftforge.common.config

Examples of net.minecraftforge.common.config.Property


        loadItemProperty("emblem");
    }

    private static void changeItemProperty(String oldTag, String newTag) {
        Map<String, Property> items = configItems.getCategory(CAT_ITEMS);
        Property prop = items.remove(oldTag);
        if (prop != null) {
            prop.setName(newTag);
            items.put(newTag, prop);
        }

        loadItemProperty(newTag);
    }
View Full Code Here


        loadItemProperty(newTag);
    }

    private static void loadItemProperty(String tag) {
        tag = MiscTools.cleanTag(tag);
        Property prop = configItems.get(CAT_ITEMS, tag, true);
        enabledItems.put(tag, prop.getBoolean(true));
    }
View Full Code Here

        enabledItems.put(tag, prop.getBoolean(true));
    }

    public static void loadBoreMineableBlocks() {
        String tag = "mineableBlocks";
        Property prop = get(CAT_TWEAKS_CARTS + ".bore", tag, "{}", "add block ids to '{t}' in a common seperated list to define non-vanilla blocks mineable by the tunnel bore \n"
                + "ignored if 'tweaks.carts.bore.mineAllBlocks=true' \n"
                + "metadata sensative entries can be defined in the form 'modid:blockname#metadata' \n"
                + "Example:{t}= { minecraft:stone, minecraft:stonebrick#3 }");
        boreMineableBlocksString = prop.getString();
    }
View Full Code Here

            throw new RuntimeException("Railcraft Fluid Entry does not exist: " + tag);
        return gen;
    }

    private static List<Integer> getIntegerList(String cat, String tag, int maxEntries) {
        Property prop = configMain.get(cat, tag, "");
        String value = prop.getString();
        if (value.equals(""))
            return Collections.EMPTY_LIST;
        String[] tokens = value.split(",");
        List<Integer> list = new ArrayList<Integer>(maxEntries);
        int count = 0;
View Full Code Here

        return get(Configuration.CATEGORY_GENERAL, tag, defaultValue, comment);
    }

    private static void loadRecipeProperty(String subcat, String tag, boolean defaultValue, String comment) {
        comment = COMMENT_PREFIX + comment.replace("{t}", tag) + COMMENT_SUFFIX;
        Property prop = configMain.get(CAT_RECIPES + "." + subcat, tag, defaultValue);
        prop.comment = comment;
        recipes.put(subcat + "." + tag, prop.getBoolean(defaultValue));
    }
View Full Code Here

        return get(cat, tag, defaultValue, false, comment);
    }

    private static boolean get(String cat, String tag, boolean defaultValue, boolean reset, String comment) {
        comment = COMMENT_PREFIX + comment.replace("{t}", tag) + COMMENT_SUFFIX;
        Property prop = configMain.get(cat, tag, defaultValue);
        prop.comment = comment;
        boolean ret = prop.getBoolean(defaultValue);
        if (reset)
            prop.set(defaultValue);
        return ret;
    }
View Full Code Here

            prop.set(defaultValue);
        return ret;
    }

    private static boolean get(Configuration config, String cat, String tag, boolean defaultValue) {
        Property prop = config.get(cat, tag, defaultValue);
        return prop.getBoolean(defaultValue);
    }
View Full Code Here

        return get(Configuration.CATEGORY_GENERAL, tag, defaultValue, comment);
    }

    private static int get(String cat, String tag, int defaultValue, String comment) {
        comment = COMMENT_PREFIX + comment.replace("{t}", tag) + COMMENT_SUFFIX;
        Property prop = configMain.get(cat, tag, defaultValue);
        prop.comment = comment;
        return parseInteger(prop, defaultValue);
    }
View Full Code Here

        return parseInteger(prop, defaultValue);
    }

    private static int get(String cat, String tag, int min, int defaultValue, int max, String comment) {
        comment = COMMENT_PREFIX + comment.replace("{t}", tag) + COMMENT_SUFFIX;
        Property prop = configMain.get(cat, tag, defaultValue);
        prop.comment = comment;
        int parsed = parseInteger(prop, defaultValue);
        int clamped = Math.max(parsed, min);
        clamped = Math.min(clamped, max);
        if (clamped != parsed)
            prop.set(clamped);
        return clamped;
    }
View Full Code Here

        return clamped;
    }

    private static float get(String cat, String tag, float min, float defaultValue, float max, String comment) {
        comment = COMMENT_PREFIX + comment.replace("{t}", tag) + COMMENT_SUFFIX;
        Property prop = configMain.get(cat, tag, defaultValue);
        prop.comment = comment;
        double parsed = parseDouble(prop, defaultValue);
        double clamped = Math.max(parsed, min);
        clamped = Math.min(clamped, max);
        if (clamped != parsed)
            prop.set(clamped);
        return (float) clamped;
    }
View Full Code Here

TOP

Related Classes of net.minecraftforge.common.config.Property

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.