Package net.canarymod.api

Examples of net.canarymod.api.OfflinePlayer


            return;
        }
        Player target = Canary.getServer().matchPlayer(args[1]);

        if (target == null) {
            OfflinePlayer oplayer = Canary.getServer().getOfflinePlayer(args[1]);
            for (Group g : oplayer.getPlayerGroups()) {
                if (g.getName().equals(args[2])) {
                    caller.message(Colors.LIGHT_GREEN + args[2] + ": " + Translator.translate("yes"));
                    return;
                }
            }
View Full Code Here


    // groupmod permission add group value
    public void execute(MessageReceiver caller, String[] args) {
        Player player = Canary.getServer().matchPlayer(args[1]);
        PermissionNode node = PermissionNode.fromString(args[2]);
        if (player == null) {
            OfflinePlayer oplayer = Canary.getServer().getOfflinePlayer(args[1]);
            oplayer.getPermissionProvider().addPermission(node.getName(), node.getValue());
        }
        else {
            player.getPermissionProvider().addPermission(node.getName(), node.getValue());
        }
        caller.message(Colors.YELLOW + Translator.translate("modify permission added"));
View Full Code Here

    // groupmod permission add group value
    public void execute(MessageReceiver caller, String[] args) {
        Player player = Canary.getServer().matchPlayer(args[1]);
        PermissionNode node = PermissionNode.fromString(args[2]);
        if (player == null) {
            OfflinePlayer oplayer = Canary.getServer().getOfflinePlayer(args[1]);
            Canary.permissionManager().removePlayerPermission(node.getName(), oplayer.getName(), oplayer.getWorld().getFqName());
        }
        else {
            Canary.permissionManager().removePlayerPermission(node.getName(), player);
        }
        caller.message(Colors.YELLOW + Translator.translate("modify permission removed"));
View Full Code Here

            return;
        }
        Player target = Canary.getServer().matchPlayer(args[1]);

        if (target == null) {
            OfflinePlayer oplayer = Canary.getServer().getOfflinePlayer(args[1]);
            for (Group g : oplayer.getPlayerGroups()) {
                caller.message(g.getName() + (g.hasParent() ? " : " + g.getParent().getName() : ""));
            }
            return;
        }
        for (Group g : target.getPlayerGroups()) {
View Full Code Here

        Player player = Canary.getServer().matchPlayer(args[1]);
        PermissionNode node = PermissionNode.fromString(args[2]);
        boolean result;
        boolean hasPath;
        if (player == null) {
            OfflinePlayer oplayer = Canary.getServer().getOfflinePlayer(args[1]);
            result = oplayer.hasPermission(node.getName());
            hasPath = oplayer.getPermissionProvider().pathExists(node.getName());
        }
        else {
            result = player.hasPermission(node.getName());
            hasPath = player.getPermissionProvider().pathExists(node.getName());
        }
View Full Code Here

        if (group == null) {
            caller.notice(Translator.translateAndFormat("unknown group", args[2]));
            return;
        }
        if (target == null) {
            OfflinePlayer oplayer = Canary.getServer().getOfflinePlayer(args[1]);
            if (!oplayer.isInGroup(group, true)) {
                oplayer.addGroup(group);
                caller.message(Colors.YELLOW + Translator.translate("modify group add"));
            }
            return;
        }
        if (!target.isInGroup(group, true)) {
View Full Code Here

public class PlayerPermissionList implements NativeCommand {
    // groupmod permission add group value
    public void execute(MessageReceiver caller, String[] args) {
        Player player = Canary.getServer().matchPlayer(args[1]);
        if (player == null) {
            OfflinePlayer oplayer = Canary.getServer().getOfflinePlayer(args[1]);
            oplayer.getPermissionProvider().printPermissionsToCaller(caller);
            return;
        }
        player.getPermissionProvider().printPermissionsToCaller(caller);
    }
View Full Code Here

        if (args.length >= 3) {
            prefix = StringUtils.joinString(args, " ", 2).replaceAll("&([A-FK-Oa-fk-oRr0-9])", "\u00A7$1");
        }
        Player target = Canary.getServer().matchPlayer(args[1]);
        if (target == null) {
            OfflinePlayer oplayer = Canary.getServer().getOfflinePlayer(args[1]);
            oplayer.setPrefix(prefix);
            caller.message(Colors.YELLOW + Translator.translate("modify prefix set"));
            return;
        }
        target.setPrefix(prefix);
        caller.message(Colors.YELLOW + Translator.translate("modify prefix set"));
View Full Code Here

        if (group == null) {
            caller.notice(Translator.translateAndFormat("unknown group", args[2]));
            return;
        }
        if (target == null) {
            OfflinePlayer oplayer = Canary.getServer().getOfflinePlayer(args[1]);
            oplayer.setGroup(group);
            caller.message(Colors.YELLOW + Translator.translate("modify group set"));
            return;
        }
        target.setGroup(group);
        caller.message(Colors.YELLOW + Translator.translate("modify group set"));
View Full Code Here

            else {
                sendData(caller, "Home: ", "Not set");
            }
        }
        else if (args.length == 2) {
            OfflinePlayer oSubject = Canary.getServer().getOfflinePlayer(args[1]);
            if (oSubject != null) {
                caller.message(TextFormat.GREEN + oSubject.getName() + "'s Offline info:");
                sendData(caller, "First Joined: ", oSubject.getFirstJoined());
                sendData(caller, "Time Played: ", ToolBox.getTimeUntil(oSubject.getTimePlayed()));
                sendData(caller, "Muted: ", oSubject.isMuted());
                sendData(caller, "Prefix: ", oSubject.getPrefix());
                sendData(caller, "Primary Group: ", oSubject.getGroup().getName());
                sendData(caller, "Other Groups: ", oSubject.getPlayerGroups());
                Position l = oSubject.getPosition();
                sendData(caller, "Position: ", String.format("X: %.2f Y: %.2f Z: %.2f", l.getX(), l.getY(), l.getZ()));
                sendData(caller, "World: ", oSubject.getWorld().getFqName());
                Warp home = Canary.warps().getHome(oSubject.getName());
                if (home != null) {
                    l = home.getLocation();
                    sendData(caller, "Home: ", String.format("X: %.2f Y: %.2f Z: %.2f", l.getX(), l.getY(), l.getZ()));
                }
                else {
View Full Code Here

TOP

Related Classes of net.canarymod.api.OfflinePlayer

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.