Class Map

java.lang.Object
com.valhalla.sdk.api.methods.Map

public final class Map extends Object
Local map and collision helpers modeled after the common DreamBot surface.
  • Method Details

    • isLocal

      public static boolean isLocal(Tile tile)
      Tests whether a tile is loaded by the local scene.
      Parameters:
      tile - tile to test
      Returns:
      true when the tile is loaded
    • canReach

      public static boolean canReach(Tile destination)
      Tests local collision reachability from the player.
      Parameters:
      destination - target tile
      Returns:
      true when a collision-valid path exists
    • canReach

      public static boolean canReach(Tile start, Tile destination)
      Tests local collision reachability between two tiles.
      Parameters:
      start - path origin
      destination - path target
      Returns:
      true when a collision-valid path exists
    • canReach

      public static boolean canReach(CollisionMap map, Tile start, Tile destination)
      Tests reachability against an explicit collision snapshot.
      Parameters:
      map - collision snapshot
      start - path origin
      destination - path target
      Returns:
      true when a collision-valid path exists
    • exactDistance

      public static int exactDistance(Tile destination)
      Computes collision-path distance from the player.
      Parameters:
      destination - path target
      Returns:
      number of transitions, or -1 when unreachable
    • exactDistance

      public static int exactDistance(Tile start, Tile destination)
      Computes collision-path distance between two tiles.
      Parameters:
      start - path origin
      destination - path target
      Returns:
      number of transitions, or -1 when unreachable
    • exactDistance

      public static int exactDistance(CollisionMap map, Tile start, Tile destination)
      Computes distance against an explicit collision snapshot.
      Parameters:
      map - collision snapshot
      start - path origin
      destination - path target
      Returns:
      number of transitions, or -1 when unreachable
    • getFlag

      public static int getFlag(Tile tile)
      Reads normalized collision flags for a loaded tile.
      Parameters:
      tile - tile to inspect
      Returns:
      normalized collision bit mask
    • getWalkable

      public static Optional<Tile> getWalkable(Tile tile)
      Finds the nearest walkable tile within eight tiles.
      Parameters:
      tile - preferred tile
      Returns:
      the preferred tile or its nearest walkable neighbor
    • getWalkable

      public static Optional<Tile> getWalkable(CollisionMap map, Tile tile, int radius)
      Finds the nearest walkable tile within a bounded square.
      Parameters:
      map - collision snapshot
      tile - preferred tile
      radius - non-negative search radius
      Returns:
      the preferred tile or its nearest walkable neighbor