Package net.aufdemrand.denizen.tags

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


        // -->
        if (attribute.startsWith("list_online_ops")) {
            ArrayList<dPlayer> players = new ArrayList<dPlayer>();
            for (Player player : Bukkit.getOnlinePlayers())
                if (player.isOp()) players.add(dPlayer.mirrorBukkitPlayer(player));
            event.setReplaced(new dList(players).getAttribute(attribute.fulfill(1)));
            return;
        }

        // <--[tag]
        // @attribute <server.list_offline_ops>
View Full Code Here


        // -->
        if (attribute.startsWith("list_offline_ops")) {
            ArrayList<dPlayer> players = new ArrayList<dPlayer>();
            for (OfflinePlayer player : Bukkit.getOfflinePlayers())
                if (player.isOp() && !player.isOnline()) players.add(dPlayer.mirrorBukkitPlayer(player));
            event.setReplaced(new dList(players).getAttribute(attribute.fulfill(1)));
            return;
        }

        // <--[tag]
        // @attribute <server.motd>
View Full Code Here

        // @returns Element
        // @description
        // Returns the server's current MOTD
        // -->
        if (attribute.startsWith("motd")) {
            event.setReplaced(new Element(Bukkit.getServer().getMotd()).getAttribute(attribute.fulfill(1)));
            return;
        }
        // TODO: Add everything else from Bukkit.getServer().*

    }
View Full Code Here

                            max = store;
                        }

                        event.setReplaced(new Element(
                                String.valueOf(CoreUtilities.getRandom().nextInt(max - min + 1) + min))
                                .getAttribute(attribute.fulfill(3)));
                    }
                }
            }

            // <--[tag]
View Full Code Here

            // @description
            // Returns a random decimal number from 0 to 1
            // -->
            else if (subType.equalsIgnoreCase("DECIMAL"))
                event.setReplaced(new Element(CoreUtilities.getRandom().nextDouble())
                        .getAttribute(attribute.fulfill(2)));

                // <--[tag]
                // @attribute <util.random.gauss>
                // @returns Element
                // @description
View Full Code Here

                // Returns a random decimal number with a gaussian distribution.
                // 70% of all results will be within the range of -1 to 1.
                // -->
            else if (subType.equalsIgnoreCase("GAUSS"))
                event.setReplaced(new Element(CoreUtilities.getRandom().nextGaussian())
                        .getAttribute(attribute.fulfill(2)));

            // TODO: Delete (Deprecated in favor of li@list.random)
            else if (subType.equalsIgnoreCase("ELEMENT")) {
                dList list = dList.valueOf(subTypeContext);
                event.setReplaced(new Element(list.get(new Random().nextInt(list.size())))
View Full Code Here

            // TODO: Delete (Deprecated in favor of li@list.random)
            else if (subType.equalsIgnoreCase("ELEMENT")) {
                dList list = dList.valueOf(subTypeContext);
                event.setReplaced(new Element(list.get(new Random().nextInt(list.size())))
                        .getAttribute(attribute.fulfill(2)));
            }

            // <--[tag]
            // @attribute <util.random.uuid>
            // @returns Element
View Full Code Here

            // @description
            // Returns a random unique ID.
            // -->
            else if (subType.equalsIgnoreCase("UUID"))
                event.setReplaced(new Element(UUID.randomUUID().toString())
                        .getAttribute(attribute.fulfill(2)));

            // <--[tag]
            // @attribute <util.random.duuid>
            // @returns Element
            // @description
View Full Code Here

            // Returns a random 'denizen' unique ID, which is made of a randomly generated sentence.
            // -->
            else if (subType.equalsIgnoreCase("DUUID"))
                event.setReplaced(new Element(ScriptQueue
                        .getNextId(event.hasSubTypeContext() ? event.getSubTypeContext(): "DUUID"))
                        .getAttribute(attribute.fulfill(2)));
        }


        else if (type.equalsIgnoreCase("SUBSTR")
                || type.equalsIgnoreCase("TRIM")
View Full Code Here

            if (to > text.length())
                to = text.length() + 1;

            event.setReplaced(new Element(text.substring(from - 1, to - 1))
                    .getAttribute(attribute.fulfill(tags)));
        }


        // TODO: Delete (Deprecated in favor of el@element.replace)
        else if (type.equalsIgnoreCase("REPLACE")) {
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.