Package net.storm.api.movement
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 TypeMethodDescriptionbooleancanWalk(net.runelite.api.coords.Direction direction, int startFlag, int endFlag) Checks if walking is possible in a direction based on collision flags.booleancheck(int flag, int checkFlag) Checks if a specific collision flag is set.intgetCollisionFlag(net.runelite.api.coords.WorldPoint point) Gets the collision flag for a world point.net.runelite.api.coords.WorldPointgetNeighbour(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> getVisitedTiles(Locatable locatable) Gets all tiles that can be reached by flood fill from an entity.booleanhasDoor(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.booleanChecks if there is a door in the specified direction from a tile.booleanChecks if movement between tiles is blocked by a closed door.booleanisInteractable(Locatable locatable) Checks if an entity can be interacted with from the player's position.booleanisObstacle(int endFlag) Checks if a tile with the given flag is an obstacle.booleanisObstacle(net.runelite.api.coords.WorldPoint worldPoint) Checks if a world point is an obstacle.booleanisWalkable(net.runelite.api.coords.WorldPoint worldPoint) Checks if a tile is walkable (not blocked by collision).booleanisWalled(net.runelite.api.coords.Direction direction, int startFlag) Checks if movement in a direction is blocked by a wall.booleanisWalled(net.runelite.api.coords.WorldPoint source, net.runelite.api.coords.WorldPoint destination) Checks if movement between two points is blocked by a wall.booleanChecks 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 valuecheckFlag- 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 movementstartFlag- 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 pointdestination- the destination point- Returns:
- true if a wall blocks movement
-
isWalled
Checks if movement between two tiles is blocked by a wall.- Parameters:
source- the source tiledestination- 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 pointdirection- the direction to check- Returns:
- true if a door exists
-
hasDoor
Checks if there is a door in the specified direction from a tile.- Parameters:
source- the source tiledirection- the direction to check- Returns:
- true if a door exists
-
isDoored
Checks if movement between tiles is blocked by a closed door.- Parameters:
source- the source tiledestination- 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 movementstartFlag- the collision flag of the source tileendFlag- 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 directionsource- the source point- Returns:
- the neighboring point
-
getVisitedTiles
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
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
-