Interface IReachable


public interface IReachable
Provides utilities for checking tile reachability and collision.

This interface handles collision detection for pathfinding:

  • Checking if tiles are walkable
  • Detecting walls and doors
  • Finding neighboring tiles
  • Checking if entities are interactable

Collision flags are bitmasks that indicate what types of movement are blocked on a tile (north, south, east, west, full block, etc.).

See Also:
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    canWalk(net.runelite.api.coords.Direction direction, int startFlag, int endFlag)
    Checks if walking is possible in a direction based on collision flags.
    boolean
    check(int flag, int checkFlag)
    Checks if a specific collision flag is set.
    int
    getCollisionFlag(net.runelite.api.coords.WorldPoint point)
    Gets the collision flag for a world point.
    net.runelite.api.coords.WorldPoint
    getNeighbour(net.runelite.api.coords.Direction direction, net.runelite.api.coords.WorldPoint source)
    Gets the neighboring point in a direction.
    List<net.runelite.api.coords.WorldPoint>
    getVisitedTiles(net.runelite.api.coords.WorldPoint worldPoint)
    Gets all tiles that can be reached by flood fill from a point.
    List<net.runelite.api.coords.WorldPoint>
    Gets all tiles that can be reached by flood fill from an entity.
    boolean
    hasDoor(net.runelite.api.coords.WorldPoint source, net.runelite.api.coords.Direction direction)
    Checks if there is a door in the specified direction from a point.
    boolean
    hasDoor(ITile source, net.runelite.api.coords.Direction direction)
    Checks if there is a door in the specified direction from a tile.
    boolean
    isDoored(ITile source, ITile destination)
    Checks if movement between tiles is blocked by a closed door.
    boolean
    Checks if an entity can be interacted with from the player's position.
    boolean
    isObstacle(int endFlag)
    Checks if a tile with the given flag is an obstacle.
    boolean
    isObstacle(net.runelite.api.coords.WorldPoint worldPoint)
    Checks if a world point is an obstacle.
    boolean
    isWalkable(net.runelite.api.coords.WorldPoint worldPoint)
    Checks if a tile is walkable (not blocked by collision).
    boolean
    isWalled(net.runelite.api.coords.Direction direction, int startFlag)
    Checks if movement in a direction is blocked by a wall.
    boolean
    isWalled(net.runelite.api.coords.WorldPoint source, net.runelite.api.coords.WorldPoint destination)
    Checks if movement between two points is blocked by a wall.
    boolean
    isWalled(ITile source, ITile destination)
    Checks if movement between two tiles is blocked by a wall.
  • Method Details

    • check

      boolean check(int flag, int checkFlag)
      Checks if a specific collision flag is set.
      Parameters:
      flag - the full flag value
      checkFlag - the flag to check for
      Returns:
      true if the flag is set
    • isObstacle

      boolean isObstacle(int endFlag)
      Checks if a tile with the given flag is an obstacle.
      Parameters:
      endFlag - the collision flag
      Returns:
      true if the tile is an obstacle
    • isObstacle

      boolean isObstacle(net.runelite.api.coords.WorldPoint worldPoint)
      Checks if a world point is an obstacle.
      Parameters:
      worldPoint - the point to check
      Returns:
      true if the tile is an obstacle
    • getCollisionFlag

      int getCollisionFlag(net.runelite.api.coords.WorldPoint point)
      Gets the collision flag for a world point.
      Parameters:
      point - the point to query
      Returns:
      the collision flag bitmask
    • isWalled

      boolean isWalled(net.runelite.api.coords.Direction direction, int startFlag)
      Checks if movement in a direction is blocked by a wall.
      Parameters:
      direction - the direction of movement
      startFlag - the collision flag of the source tile
      Returns:
      true if a wall blocks movement
    • isWalled

      boolean isWalled(net.runelite.api.coords.WorldPoint source, net.runelite.api.coords.WorldPoint destination)
      Checks if movement between two points is blocked by a wall.
      Parameters:
      source - the source point
      destination - the destination point
      Returns:
      true if a wall blocks movement
    • isWalled

      boolean isWalled(ITile source, ITile destination)
      Checks if movement between two tiles is blocked by a wall.
      Parameters:
      source - the source tile
      destination - the destination tile
      Returns:
      true if a wall blocks movement
    • hasDoor

      boolean hasDoor(net.runelite.api.coords.WorldPoint source, net.runelite.api.coords.Direction direction)
      Checks if there is a door in the specified direction from a point.
      Parameters:
      source - the source point
      direction - the direction to check
      Returns:
      true if a door exists
    • hasDoor

      boolean hasDoor(ITile source, net.runelite.api.coords.Direction direction)
      Checks if there is a door in the specified direction from a tile.
      Parameters:
      source - the source tile
      direction - the direction to check
      Returns:
      true if a door exists
    • isDoored

      boolean isDoored(ITile source, ITile destination)
      Checks if movement between tiles is blocked by a closed door.
      Parameters:
      source - the source tile
      destination - the destination tile
      Returns:
      true if a closed door blocks movement
    • canWalk

      boolean canWalk(net.runelite.api.coords.Direction direction, int startFlag, int endFlag)
      Checks if walking is possible in a direction based on collision flags.
      Parameters:
      direction - the direction of movement
      startFlag - the collision flag of the source tile
      endFlag - the collision flag of the destination tile
      Returns:
      true if walking is possible
    • getNeighbour

      net.runelite.api.coords.WorldPoint getNeighbour(net.runelite.api.coords.Direction direction, net.runelite.api.coords.WorldPoint source)
      Gets the neighboring point in a direction.
      Parameters:
      direction - the direction
      source - the source point
      Returns:
      the neighboring point
    • getVisitedTiles

      List<net.runelite.api.coords.WorldPoint> getVisitedTiles(Locatable locatable)
      Gets all tiles that can be reached by flood fill from an entity.

      Used to determine valid interaction positions.

      Parameters:
      locatable - the entity to start from
      Returns:
      list of reachable tiles
    • getVisitedTiles

      List<net.runelite.api.coords.WorldPoint> getVisitedTiles(net.runelite.api.coords.WorldPoint worldPoint)
      Gets all tiles that can be reached by flood fill from a point.
      Parameters:
      worldPoint - the starting point
      Returns:
      list of reachable tiles
    • isInteractable

      boolean isInteractable(Locatable locatable)
      Checks if an entity can be interacted with from the player's position.
      Parameters:
      locatable - the entity to check
      Returns:
      true if the entity is interactable
    • isWalkable

      boolean isWalkable(net.runelite.api.coords.WorldPoint worldPoint)
      Checks if a tile is walkable (not blocked by collision).
      Parameters:
      worldPoint - the point to check
      Returns:
      true if the tile is walkable