Package com.ensifera.animosity.craftirc.libs.com.sk89q.util.config

Examples of com.ensifera.animosity.craftirc.libs.com.sk89q.util.config.ConfigurationNode


        }
    }

    public String cColorGameFromIrc(String irc) {
        irc = this.cColorIrcNormalize(irc);
        ConfigurationNode color;
        final Iterator<ConfigurationNode> it = this.colormap.iterator();
        while (it.hasNext()) {
            color = it.next();
            //Enforce two digit comparisons.
            if (color.getString("irc", "").equals(irc) || "0".concat(color.getString("irc", "")).equals(irc)) {
                return color.getString("game", this.cColorGameFromName("foreground"));
            }
        }
        return this.cColorGameFromName("foreground");
    }
View Full Code Here


        }
        return this.cColorGameFromName("foreground");
    }

    public String cColorGameFromName(String name) {
        ConfigurationNode color;
        final Iterator<ConfigurationNode> it = this.colormap.iterator();
        while (it.hasNext()) {
            color = it.next();
            if (color.getString("name").equalsIgnoreCase(name) && (color.getProperty("game") != null)) {
                return color.getString("game", "\u00C2\u00A7f");
            }
        }
        if (name.equalsIgnoreCase("foreground")) {
            return "\u00C2\u00A7f";
        } else {
View Full Code Here

        }
        return results;
    }

    public boolean cPathExists(String source, String target) {
        final ConfigurationNode pathNode = this.getPathNode(source, target);
        return (pathNode != null) && !pathNode.getBoolean("disable", false);
    }
View Full Code Here

        final ConfigurationNode pathNode = this.getPathNode(source, target);
        return (pathNode != null) && !pathNode.getBoolean("disable", false);
    }

    public boolean cPathAttribute(String source, String target, String attribute) {
        final ConfigurationNode node = this.getPathNode(source, target);
        if (node.getProperty(attribute) != null) {
            return node.getBoolean(attribute, false);
        } else {
            return this.configuration.getNode("default-attributes").getBoolean(attribute, false);
        }
    }
View Full Code Here

    public List<ConfigurationNode> cChannels(int bot) {
        return this.channodes.get(bot);
    }

    private ConfigurationNode getPathNode(String source, String target) {
        ConfigurationNode result = this.paths.get(new Path(source, target));
        if (result == null) {
            return this.configuration.getNode("default-attributes");
        }
        ConfigurationNode basepath;
        if (result.getKeys().contains("base") && ((basepath = result.getNode("base")) != null)) {
            final ConfigurationNode basenode = this.paths.get(new Path(basepath.getString("source", ""), basepath.getString("target", "")));
            if (basenode != null) {
                result = basenode;
            }
        }
        return result;
View Full Code Here

        final String source = this.getTag(msg.getSource()), target = this.getTag(realTarget != null ? realTarget : msg.getTarget());
        if ((source == null) || (target == null)) {
            this.logWarn("Attempted to obtain formatting for invalid path " + source + " -> " + target + " .");
            return this.cDefaultFormatting(eventType, msg);
        }
        final ConfigurationNode pathConfig = this.paths.get(new Path(source, target));
        if ((pathConfig != null) && (pathConfig.getString("formatting." + eventType, null) != null)) {
            return pathConfig.getString("formatting." + eventType, null);
        } else {
            return this.cDefaultFormatting(eventType, msg);
        }
    }
View Full Code Here

        //As a function because it's more handy to use like this.
        return (color.length() == 1 ? "0" : "") + color;
    }

    public String cColorIrcFromGame(String game) {
        ConfigurationNode color;
        final Iterator<ConfigurationNode> it = this.colormap.iterator();
        String c = null;
        while (it.hasNext()) {
            color = it.next();
            if (color.getString("game").equals(game)) {
                c = this.cColorIrcNormalize(color.getString("irc", this.cColorIrcFromName("foreground")));
                break;
            }
        }
        if (c == null) {
            c = this.cColorIrcFromName("foreground");
View Full Code Here

        }
        return c.equals("-1") ? Colors.NORMAL : "\u0003" + c;
    }

    public String cColorIrcFromName(String name) {
        ConfigurationNode color;
        final Iterator<ConfigurationNode> it = this.colormap.iterator();
        while (it.hasNext()) {
            color = it.next();
            if (color.getString("name").equalsIgnoreCase(name) && (color.getProperty("irc") != null)) {
                return this.cColorIrcNormalize(color.getString("irc", "01"));
            }
        }
        if (name.equalsIgnoreCase("foreground")) {
            return "01";
        } else {
View Full Code Here

TOP

Related Classes of com.ensifera.animosity.craftirc.libs.com.sk89q.util.config.ConfigurationNode

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.