Package com.dthielke.starburst

Examples of com.dthielke.starburst.GroupSet


    }

    @Override
    public String[] getPlayerGroups(String world, String player) {
        OfflinePlayer op = Bukkit.getOfflinePlayer(player);
        GroupSet set = perms.getGroupManager().getWorldSet(Bukkit.getWorld(world));
        User user = set.getUser(op);

        Set<Group> children = user.getChildren(true);
        List<String> groups = new ArrayList<String>();
        for (Group child : children) {
            groups.add(child.getName());
View Full Code Here


    }

    @Override
    public String getPrimaryGroup(String world, String player) {
        OfflinePlayer op = Bukkit.getOfflinePlayer(player);
        GroupSet set = perms.getGroupManager().getWorldSet(Bukkit.getWorld(world));
        User user = set.getUser(op);

        Set<Group> children = user.getChildren(false);
        if (!children.isEmpty()) {
            return children.iterator().next().getName();
        } else {
View Full Code Here

    }

    @Override
    public boolean groupAdd(String world, String group, String permission) {
        GroupManager gm = perms.getGroupManager();
        GroupSet set = gm.getWorldSet(Bukkit.getWorld(world));
        if (set.hasGroup(group)) {
            Group g = set.getGroup(group);

            boolean value = !permission.startsWith("^");
            permission = value ? permission : permission.substring(1);
            g.addPermission(permission, value, true, true);
View Full Code Here

        }
    }

    @Override
    public boolean groupHas(String world, String group, String permission) {
        GroupSet set = perms.getGroupManager().getWorldSet(Bukkit.getWorld(world));
        if (set.hasGroup(group)) {
            Group g = set.getGroup(group);
            return g.hasPermission(permission, true);
        } else {
            return false;
        }
    }
View Full Code Here

    }

    @Override
    public boolean groupRemove(String world, String group, String permission) {
        GroupManager gm = perms.getGroupManager();
        GroupSet set = gm.getWorldSet(Bukkit.getWorld(world));
        if (set.hasGroup(group)) {
            Group g = set.getGroup(group);

            boolean value = !permission.startsWith("^");
            permission = value ? permission : permission.substring(1);

            if (g.hasPermission(permission, false)) {
View Full Code Here

    }

    @Override
    public boolean playerAdd(String world, String player, String permission) {
        OfflinePlayer op = Bukkit.getOfflinePlayer(player);
        GroupSet set = perms.getGroupManager().getWorldSet(Bukkit.getWorld(world));
        User user = set.getUser(op);

        boolean value = !permission.startsWith("^");
        permission = value ? permission : permission.substring(1);
        user.addPermission(permission, value, true, true);
View Full Code Here

    }

    @Override
    public boolean playerAddGroup(String world, String player, String group) {
        OfflinePlayer op = Bukkit.getOfflinePlayer(player);
        GroupSet set = perms.getGroupManager().getWorldSet(Bukkit.getWorld(world));
        User user = set.getUser(op);

        if (set.hasGroup(group)) {
            Group g = set.getGroup(group);
            if (!user.hasChild(g, false)) {
                user.addChild(g, true);

                if (user.isActive()) {
                    user.applyPermissions(perms.getGroupManager().getFactory());
View Full Code Here

            if (p.getWorld().getName().equalsIgnoreCase(world)) {
                return p.hasPermission(permission);
            }
        }

        GroupSet set = perms.getGroupManager().getWorldSet(Bukkit.getWorld(world));
        Group user = set.getUser(op);
        return user.hasPermission(permission, true);
    }
View Full Code Here

    }

    @Override
    public boolean playerInGroup(String world, String player, String group) {
        OfflinePlayer op = Bukkit.getOfflinePlayer(player);
        GroupSet set = perms.getGroupManager().getWorldSet(Bukkit.getWorld(world));
        User user = set.getUser(op);

        if (set.hasGroup(group)) {
            Group g = set.getGroup(group);
            return user.hasChild(g, true);
        } else {
            return false;
        }
    }
View Full Code Here

    }

    @Override
    public boolean playerRemove(String world, String player, String permission) {
        OfflinePlayer op = Bukkit.getOfflinePlayer(player);
        GroupSet set = perms.getGroupManager().getWorldSet(Bukkit.getWorld(world));
        User user = set.getUser(op);

        boolean value = !permission.startsWith("^");
        permission = value ? permission : permission.substring(1);
        if (user.hasPermission(permission, false)) {
            user.removePermission(permission, true);
View Full Code Here

TOP

Related Classes of com.dthielke.starburst.GroupSet

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.