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

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


        //
        if (args[1].equalsIgnoreCase("give")) {
            // Give kit to a subject
            if (args.length >= 4) {
                boolean override = args.length > 4 && args[4].toLowerCase().equals("override");
                Player recipient = Canary.getServer().matchPlayer(args[3]);

                if (recipient != null) {
                    Kit kit = Canary.kits().getKit(args[2]);

                    if (kit != null) {
                        if (kit.giveKit(recipient, override)) {
                            recipient.message(Colors.YELLOW + Translator.translateAndFormat("kit given other", caller.getName()));
                            return;
                        }
                        else {
                            caller.notice(Translator.translateAndFormat("kit unavailable other", recipient.getName()));
                            return;
                        }
                    }
                    else {
                        caller.notice(Translator.translateAndFormat("kit invalid", args[2]));
View Full Code Here


            // Give kit to a subject
            if (args.length > 3) {
                if (!player.hasPermission("canary.command.player.kit.other")) {
                    return;
                }
                Player recipient = Canary.getServer().matchPlayer(args[3]);

                if (recipient != null) {
                    Kit kit = Canary.kits().getKit(args[2]);

                    if (kit != null) {
                        if (kit.giveKit(recipient, false)) {
                            recipient.message(Colors.YELLOW + Translator.translateAndFormat("kit given other", player.getName()));
                            return;
                        }
                        else {
                            player.notice(Translator.translateAndFormat("kit unavailable other", recipient.getName()));
                            return;
                        }
                    }
                    else {
                        player.notice(Translator.translateAndFormat("kit invalid", args[2]));
View Full Code Here

    public void execute(MessageReceiver caller, String[] args) {
        if (args[args.length - 1].equals("--help")) {
            Canary.help().getHelp(caller, "playermod group remove");
            return;
        }
        Player target = Canary.getServer().matchPlayer(args[1]);
        Group group = Canary.usersAndGroups().getGroup(args[2]);
        if (group == null) {
            caller.notice(Translator.translateAndFormat("unknown group", args[2]));
            return;
        }
        if (target == null) {
            OfflinePlayer oplayer = Canary.getServer().getOfflinePlayer(args[1]);
            if (oplayer.removeGroup(group)) {
                caller.message(Colors.YELLOW + Translator.translate("modify group removed"));
            }
            else {
                caller.message(Colors.YELLOW + Translator.translate("modify group removed failed"));
            }
            return;
        }

        if (target.removeGroup(group)) {
            caller.message(Colors.YELLOW + Translator.translate("modify group removed"));
        }
        else {
            caller.message(Colors.YELLOW + Translator.translate("modify group removed failed"));
        }
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.