Package net.canarymod.warp

Examples of net.canarymod.warp.Warp


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


                Group[] groups = makeGroupArray(data.groups);
                String owner = ToolBox.stringToNull(data.owner);
                String name = data.name;
                boolean playerHome = data.isPlayerHome;
                Location loc = Location.fromString(data.location);
                Warp warp;

                if (owner != null) {
                    warp = new Warp(loc, name, owner, playerHome);
                }
                else if (groups != null && groups.length > 0) {
                    warp = new Warp(loc, groups, name);
                }
                else {
                    // assume this is a public warp
                    warp = new Warp(loc, name);
                }
                warps.add(warp);
            }
        }
        catch (DatabaseReadException e) {
View Full Code Here

                player.notice(Translator.translate("setwarp failed"));
                return;
            }
            // SET PUBLIC WARP
            if (args.length == 2 && player.hasPermission("canary.command.warp.set.public")) {
                Warp newWarp = new Warp(player.getLocation(), args[1]);

                Canary.warps().addWarp(newWarp);
                player.message(Colors.YELLOW + Translator.translateAndFormat("setwarp success", args[1]));
            }
            else if (args.length > 3) {
                // SET GROUP SPECIFIC WARP
                if (args[2].equalsIgnoreCase("G") && player.hasPermission("canary.command.warp.set.group")) {
                    Group[] groups = new Group[args.length - 3];

                    for (int i = 0; i < groups.length; i++) {
                        groups[i] = Canary.usersAndGroups().getGroup(args[i + 3]);
                    }
                    Warp newWarp = new Warp(player.getLocation(), groups, args[1]);

                    Canary.warps().addWarp(newWarp);
                    player.message(Colors.YELLOW + Translator.translateAndFormat("setwarp success group", args[1]));
                    return;
                }
                // SET PRIVATE WARP
                if (args[2].equalsIgnoreCase("P") && player.hasPermission("canary.command.warp.set.private")) {
                    Warp newWarp = new Warp(player.getLocation(), args[1], args[3], false);

                    Canary.warps().addWarp(newWarp);
                    player.message(Colors.YELLOW + Translator.translateAndFormat("setwarp success private", args[1]));
                }
                else {
View Full Code Here

* @author Chris (damagefilter)
*/
public class WarpRemove implements NativeCommand {
    public void execute(MessageReceiver caller, String[] args) {
        if (Canary.warps().warpExists(args[1])) {
            Warp target = Canary.warps().getWarp(args[1]);
            Canary.warps().removeWarp(target);
            caller.message(Colors.YELLOW + Translator.translateAndFormat("warp removed", target.getName()));
        }
        else {
            caller.notice(Translator.translateAndFormat("warp unknown", args[1]));
        }
    }
View Full Code Here

        if (caller instanceof Server || caller instanceof CommandBlock) {
            caller.notice(Translator.translate("warp console"));
        }
        else {
            Player player = (Player) caller;
            Warp target = Canary.warps().getWarp(args[1]);

            if (target != null) {
                if (target.warp(player)) {
                    player.message(Colors.YELLOW + Translator.translateAndFormat("warp success", target.getName()));
                    return;
                }
                else {
                    player.message(Colors.YELLOW + Translator.translateAndFormat("warp not allowed", target.getName()));
                    return;
                }
            }
            player.notice(Translator.translateAndFormat("warp unknown", args[1]));
        }
View Full Code Here

            sendData(caller, "XP Total: ", subject.getExperience());
            Location l = subject.getLocation();

            sendData(caller, "Position: ", String.format("X: %.2f Y: %.2f Z: %.2f Pitch: %.2f Yawn: %.2f", l.getX(), l.getY(), l.getZ(), l.getRotation(), l.getPitch()));
            sendData(caller, "World: ", subject.getWorld().getFqName());
            Warp home = Canary.warps().getHome(subject.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 {
                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 {
                    sendData(caller, "Home: ", "Not set");
                }
View Full Code Here

TOP

Related Classes of net.canarymod.warp.Warp

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.