Package games.stendhal.server.entity.player

Examples of games.stendhal.server.entity.player.Player.nextTo()


  @Override
  public boolean onUsed(final RPEntity user) {
    if (user instanceof Player) {
      final Player player = (Player) user;

      if (player.nextTo(this)) {
        npc.say("Hey " + user.getTitle() + ", that is my chest.");
        return true;
      } else {
        return false;
      }
View Full Code Here


    }
   
    final Player player = (Player) entity;
   
    // The player must be next to the source to start to use it.
    if (!player.nextTo(this)) {
      player.sendPrivateText("You are too far away from " + this.getName()+
        ", try to come closer.");
      return false;
    }
View Full Code Here

   
    creature.setPosition(3, 3);
    veteran.setPosition(3, 5);
    newbie.setPosition(1, 5);
    assertFalse("sanity check; target not next to attacker", veteran.nextTo(creature));
    assertFalse("sanity check; target not next to attacker", newbie.nextTo(creature));
    assertTrue("sanity check; veteran is closer than newbie",
        creature.squaredDistance(veteran) < creature.squaredDistance(newbie));
   
    // Should pick the nearest: veteran
    strat.findNewTarget(creature);
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.