Package net.canarymod.api.world.position

Examples of net.canarymod.api.world.position.Location


                WarpDataAccess data = (WarpDataAccess) dao;
                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);
                }
View Full Code Here


    private void cmdblock(CommandBlock block, String[] args) {
        Player target = Canary.getServer().matchPlayer(args[1]);

        if (target != null) {
            Location l = block.getBlock().getLocation();
            l.setY(l.getY()+1);
            target.teleportTo(l, TeleportHook.TeleportCause.COMMAND);
            block.message(Colors.YELLOW + Translator.translateAndFormat("tphere success", target.getName()));
        }
        else {
            block.notice(Translator.translateAndFormat("unknown player", args[1]));
View Full Code Here

            sendData(caller, "Mode: ", subject.getMode());
            sendData(caller, "Food Level: ", subject.getHunger());
            sendData(caller, "Food Exhaustion: ", String.format("%.2f", subject.getExhaustionLevel()));
            sendData(caller, "XP Level: ", subject.getLevel());
            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.api.world.position.Location

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.