Package net.canarymod.user

Examples of net.canarymod.user.Group


* @author Chris (damagefilter)
*/
public class GroupPermissionRemove implements NativeCommand {
    // groupmod permission add group value
    public void execute(MessageReceiver caller, String[] args) {
        Group group = Canary.usersAndGroups().getGroup(args[1]);
        if (group == null) {
            caller.notice(Translator.translateAndFormat("unknown group", args[1]));
            return;
        }
        PermissionNode node = PermissionNode.fromString(args[2]);
View Full Code Here


    public void execute(MessageReceiver caller, String[] args) {
        if (args[args.length - 1].equals("--help")) {
            Canary.help().getHelp(caller, "groupmod prefix");
            return;
        }
        Group group = Canary.usersAndGroups().getGroup(args[1]);
        if (group == null) {
            caller.notice(Translator.translateAndFormat("unknown group", args[1]));
            return;
        }
        String prefix = null;
        if (args.length >= 3) {
            prefix = StringUtils.joinString(args, " ", 2).replaceAll("&([A-FK-Oa-fk-oRr0-9])", "\u00A7$1");
        }
        group.setPrefix(prefix);
        Canary.usersAndGroups().updateGroup(group);
        caller.message(Colors.YELLOW + Translator.translate("modify prefix set"));
    }
View Full Code Here

    public void execute(MessageReceiver caller, String[] args) {
        if (args[args.length - 1].equals("--help")) {
            Canary.help().getHelp(caller, "group remove");
            return;
        }
        Group group = Canary.usersAndGroups().getGroup(args[1]);
        if (group == null) {
            caller.notice(Translator.translateAndFormat("unknown group", args[1]));
            return;
        }
        if (group.getName().equalsIgnoreCase(Canary.usersAndGroups().getDefaultGroup().getName())) {
            caller.notice(Translator.translate("group remove default group"));
            return;
        }
        // Fix players that had the said group
        for (Player player : Canary.getServer().getPlayerList()) {
            if (player.getGroup().getName().equals(group.getName())) {
                player.setGroup(group.getParent());
            }
        }
        Canary.usersAndGroups().removeGroup(group);
        caller.message(Colors.YELLOW + Translator.translateAndFormat("group removed", group.getName()));
    }
View Full Code Here

* @author Chris (damagefilter)
*/
public class GroupPermissionAdd implements NativeCommand {
    // groupmod permission add group value
    public void execute(MessageReceiver caller, String[] args) {
        Group group = Canary.usersAndGroups().getGroup(args[1]);
        if (group == null) {
            caller.notice(Translator.translateAndFormat("unknown group", args[1]));
            return;
        }
        PermissionNode node = PermissionNode.fromString(args[2]);
        group.getPermissionProvider().addPermission(node.getName(), node.getValue());
        caller.message(Colors.YELLOW + Translator.translate("modify permission added"));
    }
View Full Code Here

    public void execute(MessageReceiver caller, String[] args) {
        if (args[args.length - 1].equals("--help")) {
            Canary.help().getHelp(caller, "groupmod check");
            return;
        }
        Group g = Canary.usersAndGroups().getGroup(args[1]);
        if (g == null) {
            caller.notice(Translator.translateAndFormat("unknown group", args[1]));
            return;
        }
        caller.message("Name: " + g.getName());
        caller.message("ID: " + g.getId());
        caller.message("Prefix: " + Colors.MARKER + g.getPrefix() + g.getPrefix());
        caller.message("Parent: " + (g.hasParent() ? g.getParent().getName() : Translator.translate("no")));
    }
View Full Code Here

* @author Chris (damagefilter)
*/
public class GroupPermissionFlush implements NativeCommand {
    // groupmod permission flush group
    public void execute(MessageReceiver caller, String[] args) {
        Group group = Canary.usersAndGroups().getGroup(args[1]);
        if (group == null) {
            caller.notice(Translator.translateAndFormat("unknown group", args[1]));
            return;
        }
        group.getPermissionProvider().flushCache();
        caller.message(Colors.YELLOW + Translator.translate("modify permission cleared"));
    }
View Full Code Here

* @author Chris (damagefilter)
*/
public class GroupPermissionList implements NativeCommand {
    // groupmod permission add group value
    public void execute(MessageReceiver caller, String[] args) {
        Group group = Canary.usersAndGroups().getGroup(args[1]);
        if (group == null) {
            caller.notice(Translator.translateAndFormat("unknown group", args[1]));
            return;
        }
        group.getPermissionProvider().printPermissionsToCaller(caller);
    }
View Full Code Here

                // ADD GROUPS KIT
                if (args[4].equalsIgnoreCase("G") && player.hasPermission("canary.command.player.kit.group")) {
                    String[] groups = new String[args.length - 5];

                    for (int i = 0; i < groups.length; i++) {
                        Group g = Canary.usersAndGroups().getGroup(args[i + 5]);

                        if (g != null) {
                            groups[i] = g.getName();
                        }
                        else {
                            groups[i] = Canary.usersAndGroups().getDefaultGroup().getName();
                        }
                    }
View Full Code Here

TOP

Related Classes of net.canarymod.user.Group

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.