Package net.storm.api.movement
Interface ISailing
public interface ISailing
Interface for controlling sailing mechanics in the game.
ISailing provides methods for navigating ships across water, controlling speed and direction, and managing sail states. This interface is part of the sailing skill content and allows automation of ship movement.
Key Features
- Direction control - Set heading using compass directions or target points
- Speed control - Increase/decrease speed, set sails, or reverse
- Navigation - Automated navigation to waypoints
- State queries - Check if moving, navigating, or on a boat
Usage Example
ISailing sailing = Static.getSailing();
// Check if on a boat
if (sailing.isOnBoat()) {
// Set direction to sail north
sailing.setDirection(SailingDirection.NORTH);
// Set sails to start moving
sailing.setSails();
// Or navigate to a specific point
sailing.setDirection(new WorldPoint(2000, 2000, 0));
}
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptiondefault booleanDecreases the ship's speed using the default interaction method.booleandecreaseSpeed(InteractMethod interactMethod) Decreases the ship's speed.Gets the current heading direction of the ship.getShip()Gets the current ship instance being controlled.default booleanIncreases the ship's speed using the default interaction method.booleanincreaseSpeed(InteractMethod interactMethod) Increases the ship's speed (if possible).booleanisMoving()Checks if the ship is currently in motion.booleanChecks if the ship is currently in automated navigation mode.booleanisOnBoat()Checks if the player is currently on a boat.default booleannavigate()Starts automated navigation using the default interaction method.booleannavigate(InteractMethod interactMethod) Starts automated navigation to the current waypoint.default booleanreverse()Reverses the ship using the default interaction method.booleanreverse(InteractMethod interactMethod) Reverses the ship's direction of travel.default voidsetDirection(net.runelite.api.coords.WorldPoint target) Sets the ship's heading to point toward a target world point using the default interaction method.voidsetDirection(InteractMethod interactMethod, net.runelite.api.coords.WorldPoint target) Sets the ship's heading to point toward a target world point.voidsetDirection(InteractMethod interactMethod, SailingDirection direction) Sets the ship's heading direction using the specified interaction method.default voidsetDirection(SailingDirection direction) Sets the ship's heading direction using the default interaction method.default booleansetSails()Sets the sails using the default interaction method.booleansetSails(InteractMethod interactMethod) Sets the sails to begin moving the ship.default booleanStops automated navigation using the default interaction method.booleanstopNavigating(InteractMethod interactMethod) Stops automated navigation.default booleanUnsets the sails using the default interaction method.booleanunsetSails(InteractMethod interactMethod) Unsets (furls) the sails to stop the ship.
-
Method Details
-
getDirection
SailingDirection getDirection()Gets the current heading direction of the ship.- Returns:
- the current
SailingDirectionthe ship is facing
-
isMoving
boolean isMoving()Checks if the ship is currently in motion.- Returns:
- true if the ship is moving, false if stationary
-
setDirection
Sets the ship's heading direction using the specified interaction method.- Parameters:
interactMethod- the method to use for interaction (null for default)direction- the target sailing direction
-
setDirection
Sets the ship's heading direction using the default interaction method.- Parameters:
direction- the target sailing direction
-
setDirection
Sets the ship's heading to point toward a target world point.- Parameters:
interactMethod- the method to use for interaction (null for default)target- the target world point to sail toward
-
setDirection
default void setDirection(net.runelite.api.coords.WorldPoint target) Sets the ship's heading to point toward a target world point using the default interaction method.- Parameters:
target- the target world point to sail toward
-
setSails
Sets the sails to begin moving the ship.- Parameters:
interactMethod- the method to use for interaction (null for default)- Returns:
- true if sails were successfully set
-
setSails
default boolean setSails()Sets the sails using the default interaction method.- Returns:
- true if sails were successfully set
-
unsetSails
Unsets (furls) the sails to stop the ship.- Parameters:
interactMethod- the method to use for interaction (null for default)- Returns:
- true if sails were successfully unset
-
unsetSails
default boolean unsetSails()Unsets the sails using the default interaction method.- Returns:
- true if sails were successfully unset
-
increaseSpeed
Increases the ship's speed (if possible).- Parameters:
interactMethod- the method to use for interaction (null for default)- Returns:
- true if speed was successfully increased
-
increaseSpeed
default boolean increaseSpeed()Increases the ship's speed using the default interaction method.- Returns:
- true if speed was successfully increased
-
decreaseSpeed
Decreases the ship's speed.- Parameters:
interactMethod- the method to use for interaction (null for default)- Returns:
- true if speed was successfully decreased
-
decreaseSpeed
default boolean decreaseSpeed()Decreases the ship's speed using the default interaction method.- Returns:
- true if speed was successfully decreased
-
reverse
Reverses the ship's direction of travel.- Parameters:
interactMethod- the method to use for interaction (null for default)- Returns:
- true if reverse was successfully activated
-
reverse
default boolean reverse()Reverses the ship using the default interaction method.- Returns:
- true if reverse was successfully activated
-
getShip
Ship getShip()Gets the current ship instance being controlled.- Returns:
- the current Ship, or null if not on a ship
-
isOnBoat
boolean isOnBoat()Checks if the player is currently on a boat.- Returns:
- true if the player is on a boat
-