Package net.canarymod.api.entity.living.humanoid

Examples of net.canarymod.api.entity.living.humanoid.Player


        }
        if (!caller.hasPermission("canary.command.god.other")) {
            caller.notice(Translator.translate("god failed"));
            return;
        }
        Player other = Canary.getServer().getPlayer(args[1]);
        if (other == null) {
            caller.notice(Translator.translate("god failed") + " " + Translator.translateAndFormat("unknown player", args[1]));
            return;
        }
        if (other.getCapabilities().isInvulnerable()) {
            other.getCapabilities().setInvulnerable(false);
            caller.notice(Translator.translateAndFormat("god disabled other", other.getName()));
            other.notice(Translator.translate("god disabled"));
        }
        else {
            other.getCapabilities().setInvulnerable(true);
            caller.notice(Translator.translateAndFormat("god enabled other", other.getName()));
            other.notice(Translator.translate("god enabled"));
        }

    }
View Full Code Here


        else if (args.length == 2) {
            if (!player.hasPermission("canary.command.god.other")) {
                player.notice(Translator.translate("god failed"));
                return;
            }
            Player other = Canary.getServer().matchPlayer(args[1]);
            if (other == null) {
                player.notice(Translator.translate("god failed") + " " + Translator.translateAndFormat("unknown player", args[1]));
                return;
            }
            if (other.getCapabilities().isInvulnerable()) {
                other.getCapabilities().setInvulnerable(false);
                player.notice(Translator.translateAndFormat("god disabled other", other.getName()));
                other.notice(Translator.translate("god disabled"));
            }
            else {
                other.getCapabilities().setInvulnerable(true);
                player.notice(Translator.translateAndFormat("god enabled other", other.getName()));
                other.notice(Translator.translate("god enabled"));
            }
        }
        else {
            player.notice(Translator.translate("god failed") + " " + Translator.translate("usage"));
            Canary.help().getHelp(player, "god");
View Full Code Here

        caller.notice("Your home has been set to everywhere.");
    }

    private void player(Player player, String[] args) {
        if (args.length == 2) {
            Player target = Canary.getServer().matchPlayer(args[1]);
            if (target != null) {
                target.setHome(player.getLocation());
                target.message(Colors.YELLOW + "Your home has been set by " + player.getName());
                player.message(Colors.YELLOW + target.getName() + "'s  home has been set.");
            }
            else {
                player.notice(Translator.translateAndFormat("unknown player", args[1]));
            }
        }
View Full Code Here

    }

    //Special behaviour for command blocks, they teleport the given player to their homes
    private void others(MessageReceiver player, String[] args) {
        if (player.hasPermission("canary.command.teleport.home.other")) {
            Player target = Canary.getServer().matchPlayer(args[1]);

            if (target != null) {
                if (target.hasHome()) {
                    target.teleportTo(target.getHome());
                }
                else {
                    player.notice(Translator.translateAndFormat("no home set other", target.getName()));
                }
            }
        }
    }
View Full Code Here

                player.notice(Translator.translate("no home set"));
            }
        }
        else {
            if (player.hasPermission("canary.command.teleport.home.other")) {
                Player target = Canary.getServer().matchPlayer(args[1]);

                if (target != null) {
                    if (target.hasHome()) {
                        player.notice(Translator.translateAndFormat("home teleport other", target.getName()));
                        player.teleportTo(target.getHome());
                    }
                    else {
                        player.notice(Translator.translateAndFormat("no home set other", target.getName()));
                    }
                }
                else {
                    Warp home = Canary.warps().getHome(args[1]);
                    if (home != null) {
View Full Code Here

    public void execute(MessageReceiver caller, String[] args) {
        if (args[args.length - 1].equals("--help")) {
            Canary.help().getHelp(caller, "playermod group check");
            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;
                }
            }
            caller.message(Colors.LIGHT_RED + args[2] + ": " + Translator.translate("no"));
            return;
        }
        for (Group g : target.getPlayerGroups()) {
            if (g.getName().equals(args[2])) {
                caller.message(Colors.LIGHT_GREEN + args[2] + ": " + Translator.translate("yes"));
                return;
            }
        }
View Full Code Here

* @author Chris (damagefilter)
*/
public class PlayerPermissionAdd implements NativeCommand {
    // 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

        if (args[args.length - 1].equals("--help")) {
            Canary.help().getHelp(caller, "playermod add");
            return;
        }
        Group g = Canary.usersAndGroups().getGroup(args[2]);
        Player target = Canary.getServer().matchPlayer(args[1]);
        if (g == null) {
            caller.notice(Translator.translateAndFormat("unknown group", args[2]));
            return;
        }

        if (target == null) {
            Canary.usersAndGroups().addOfflinePlayer(args[1], g.getName());
            caller.message(Colors.YELLOW + Translator.translate("modify group set"));
            return;
        }
        target.setGroup(g);
        caller.message(Colors.YELLOW + Translator.translate("modify group set"));
    }
View Full Code Here

* @author Chris (damagefilter)
*/
public class PlayerPermissionRemove implements NativeCommand {
    // 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());
        }
View Full Code Here

    public void execute(MessageReceiver caller, String[] args) {
        if (args[args.length - 1].equals("--help")) {
            Canary.help().getHelp(caller, "playermod group list");
            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()) {
            caller.message(g.getName() + (g.hasParent() ? " : " + g.getParent().getName() : ""));
        }
    }
View Full Code Here

TOP

Related Classes of net.canarymod.api.entity.living.humanoid.Player

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.