Examples of Coordinate


Examples of palmed.edit.util.Coordinate

    {
        final int lines = lines_; // can be changed by the functor
        if( from.y_ - start.y_ <= lines )
        {
            final int length = lastLineLength_; // can be changed by the functor
            final Coordinate translatedFrom = translate( from, start );
            final Coordinate translatedTo = translate( to, start );
            if( !translatedTo.equals( translatedFrom ) )
                functor.select( getText(), translatedFrom, translatedTo );
            if( from.y_ - start.y_ == 0 )
                return new Coordinate( start.x_ + length, start.y_ + lines );
            return new Coordinate( length, start.y_ + lines );
        }
        return new Coordinate( start.x_, start.y_ + lines );
    }
View Full Code Here

Examples of simpleserver.Coordinate

    super("warpto [player] x y z", "Teleport (a player) to the given coordinates");
  }

  public void execute(Player player, String message) {
    String args[] = extractArguments(message);
    Coordinate c;

    if (args.length < 3) {
      player.addTMessage(Color.GRAY, "Usage: warpto [player] x y z");
      return;
    }

    Player target = player;
    if (args.length > 3) {
      String trg = args[0];
      target = player.getServer().findPlayer(trg);
      if (target == null) {
        player.addTMessage(Color.RED, "Player not online (%s)", trg);
        return;
      }
    }

    int x = 0;
    int y = 0;
    int z = 0;
    try {
      x = Integer.valueOf(args[args.length - 3]);
      y = Integer.valueOf(args[args.length - 2]);
      z = Integer.valueOf(args[args.length - 1]);
    } catch (Exception e) {
      player.addTMessage(Color.RED, "Invalid coordinate!");
      return;
    }

    c = new Coordinate(x, y, z);
    target.teleportSelf(c);
    player.getServer().adminLog("Admin " + player.getName() + " teleported:\t "
        + target.getName() + "\tto\t" + c.toString());
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.