Package net.aufdemrand.denizen.tags

Examples of net.aufdemrand.denizen.tags.Attribute.startsWith()


        // @attribute <server.list_permission_groups>
        // @returns dList
        // @description
        // Returns a list of all permission groups on the server.
        // -->
        if (attribute.startsWith("list_permission_groups")) {
            if (Depends.permissions == null) {
                dB.echoError("No permission system loaded! Have you installed Vault and a compatible permissions plugin?");
                return;
            }
            event.setReplaced(new dList(Arrays.asList(Depends.permissions.getGroups())).getAttribute(attribute.fulfill(1)));
View Full Code Here


        // @attribute <server.list_plugin_names>
        // @returns dList
        // @description
        // Gets a list of currently enabled plugin names from the server.
        // -->
        if (attribute.startsWith("list_plugin_names")) {
            dList plugins = new dList();
            for (Plugin plugin : Bukkit.getServer().getPluginManager().getPlugins())
                plugins.add(plugin.getName());
            event.setReplaced(plugins.getAttribute(attribute.fulfill(1)));
            return;
View Full Code Here

        // @attribute <server.list_scripts>
        // @returns dList(dScript)
        // @description
        // Gets a list of all scripts currently loaded into Denizen.
        // -->
        if (attribute.startsWith("list_scripts")) {
            dList scripts = new dList();
            for (String str : ScriptRegistry._getScriptNames())
                scripts.add("s@" + str);
            event.setReplaced(scripts.getAttribute(attribute.fulfill(1)));
            return;
View Full Code Here

        // @description
        // Returns the online player that best matches the input name.
        // EG, in a group of 'bo', 'bob', and 'bobby'... input 'bob' returns p@bob,
        // input 'bobb' returns p@bobby, and input 'b' returns p@bo.
        // -->
        if (attribute.startsWith("match_player") && attribute.hasContext(1)) {
            Player matchPlayer = null;
            String matchInput = attribute.getContext(1).toLowerCase();
            for (Player player: Bukkit.getOnlinePlayers()) {
                if (player.getName().toLowerCase().equals(matchInput)) {
                    matchPlayer = player;
View Full Code Here

        // @attribute <server.get_npcs_assigned[<assignment_script>]>
        // @returns dList(dNPC)
        // @description
        // Returns a list of all NPCs assigned to a specified script.
        // -->
        if (attribute.startsWith("get_npcs_assigned") && Depends.citizens != null
                && attribute.hasContext(1)) {
            dScript script = dScript.valueOf(attribute.getContext(1));
            if (script == null || !(script.getContainer() instanceof AssignmentScriptContainer)) {
                dB.echoError("Invalid script specified.");
            }
View Full Code Here

        // @attribute <server.get_online_players_flagged[<flag_name>]>
        // @returns dList(dPlayer)
        // @description
        // Returns a list of all online players with a specified flag set.
        // -->
        if (attribute.startsWith("get_online_players_flagged")
                && attribute.hasContext(1)) {
            String flag = attribute.getContext(1);
            ArrayList<dPlayer> players = new ArrayList<dPlayer>();
            for (Player player: Bukkit.getOnlinePlayers()) {
                if (DenizenAPI.getCurrentInstance().flagManager().getPlayerFlag(new dPlayer(player), flag).size() > 0)
View Full Code Here

        // @attribute <server.get_players_flagged[<flag_name>]>
        // @returns dList(dPlayer)
        // @description
        // Returns a list of all players with a specified flag set.
        // -->
        if (attribute.startsWith("get_players_flagged")
                && attribute.hasContext(1)) {
            String flag = attribute.getContext(1);
            ArrayList<dPlayer> players = new ArrayList<dPlayer>();
            for (Map.Entry<String, UUID> entry : dPlayer.getAllPlayers().entrySet()) {
                if (DenizenAPI.getCurrentInstance().flagManager().getPlayerFlag(entry.getValue(), flag).size() > 0)
View Full Code Here

        // @attribute <server.get_spawned_npcs_flagged[<flag_name>]>
        // @returns dList(dNPC)
        // @description
        // Returns a list of all spawned NPCs with a specified flag set.
        // -->
        if (attribute.startsWith("get_spawned_npcs_flagged") && Depends.citizens != null
                && attribute.hasContext(1)) {
            String flag = attribute.getContext(1);
            ArrayList<dNPC> npcs = new ArrayList<dNPC>();
            for (NPC npc : CitizensAPI.getNPCRegistry()) {
                dNPC dNpc = dNPC.mirrorCitizensNPC(npc);
View Full Code Here

        // @attribute <server.get_npcs_flagged[<flag_name>]>
        // @returns dList(dNPC)
        // @description
        // Returns a list of all NPCs with a specified flag set.
        // -->
        if (attribute.startsWith("get_npcs_flagged") && Depends.citizens != null
                && attribute.hasContext(1)) {
            String flag = attribute.getContext(1);
            ArrayList<dNPC> npcs = new ArrayList<dNPC>();
            for (NPC npc : CitizensAPI.getNPCRegistry()) {
                dNPC dNpc = dNPC.mirrorCitizensNPC(npc);
View Full Code Here

        // @attribute <server.list_npcs>
        // @returns dList(dNPC)
        // @description
        // Returns a list of all NPCs.
        // -->
        if (attribute.startsWith("list_npcs") && Depends.citizens != null) {
            ArrayList<dNPC> npcs = new ArrayList<dNPC>();
            for (NPC npc : CitizensAPI.getNPCRegistry())
                npcs.add(dNPC.mirrorCitizensNPC(npc));
            event.setReplaced(new dList(npcs).getAttribute(attribute.fulfill(1)));
            return;
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.