Package net.aufdemrand.denizen.flags

Examples of net.aufdemrand.denizen.flags.FlagManager


        ///////
        // Match @object format

        if (string.startsWith("fl")) {
            FlagManager flag_manager = DenizenAPI.getCurrentInstance().flagManager();
            if (string.indexOf('[') == 2) {
                int cb = string.indexOf(']');
                if (cb > 4 && string.indexOf('@') == (cb + 1)) {
                    String owner = string.substring(3, cb);
                    String flag = string.substring(cb + 2);
                    if (dPlayer.matches(owner)) {
                        dPlayer player = dPlayer.valueOf(owner);
                        if (FlagManager.playerHasFlag(player, flag))
                            return new dList(flag_manager.getPlayerFlag(player, flag));
                        else
                            dB.echoError("Player '" + owner + "' flag '" + flag + "' not found.");
                    }
                    else if (Depends.citizens != null && dNPC.matches(owner)) {
                        dNPC npc = dNPC.valueOf(owner);
                        if (FlagManager.npcHasFlag(npc, flag))
                            return new dList(flag_manager.getNPCFlag(npc.getId(), flag));
                        else
                            dB.echoError("NPC '" + owner + "' flag '" + flag + "' not found.");
                    }
                }
                else
                    dB.echoError("Invalid dFlag format: " + string);
            }
            else if (string.indexOf('@') == 2) {
                String flag = string.substring(3);
                if (FlagManager.serverHasFlag(flag))
                    return new dList(flag_manager.getGlobalFlag(flag));
                else
                    dB.echoError("Global flag '" + flag + "' not found.");
            }
            return null;
        }
View Full Code Here


            else
                name = arg.toUpperCase();
        }

        FlagManager flagMng = DenizenAPI.getCurrentInstance().flagManager();
        FlagManager.Flag flag = null;

        switch (type) {
        case NPC:
            flag = flagMng.getNPCFlag(context.getNPC().getId(), name);
            break;
        case PLAYER:
            flag = flagMng.getPlayerFlag(context.getPlayer(), name);
            break;
        case GLOBAL:
            flag = flagMng.getGlobalFlag(name);
            break;
        }

        if (index.length() == 0)
        {
View Full Code Here

TOP

Related Classes of net.aufdemrand.denizen.flags.FlagManager

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.