Fixing conflict

This commit is contained in:
Clisprail
2014-04-27 13:55:19 +02:00
9 changed files with 151 additions and 29 deletions
@@ -11,6 +11,11 @@ import org.rev317.min.api.wrappers.TilePath;
*/
public class Walking {
/**
* Walks from tile to tile
* @param from
* @param to
*/
public static void walkTo(Tile from, Tile to) {
Loader.getClient().walkTo(0, 0, 0, 0, from.getRegionY(), 0, 0, to.getRegionY(), from.getRegionX(), true, to.getRegionX());
}
@@ -27,6 +32,23 @@ public class Walking {
tilePath.traverse();
return false;
}
/**
* Gets nearest reachable tile on minimap to given tile
* @param tile
* @return nearest reachable tile on minimap
*/
public static Tile getNearestTileTo(Tile tile) {
Tile loc = Players.getMyPlayer().getLocation();
for (int i = 0; i < 1000; ++i) {
if (tile.distanceTo() < 16 && tile.isWalkable()) {
return tile;
}
tile = new Tile((loc.getX() + tile.getX()) / 2,
(loc.getY() + tile.getY()) / 2);
}
return null;
}
}