Package net.storm.sdk.game
Class Worlds
java.lang.Object
net.storm.sdk.game.Worlds
Provides static utility methods for world management and world hopping.
This class allows querying available worlds, checking world properties,
and performing world hops.
All methods in this class are static and delegate to the underlying IWorlds implementation.
Example usage:
// Get the current world
World current = Worlds.getCurrent();
int worldId = Worlds.getCurrentId();
// Check if in a members world
if (Worlds.inMembersWorld()) {
System.out.println("Currently in a members world");
}
// Find a specific world
World world301 = Worlds.getFirst(301);
// Find all members worlds that are normal (not PvP, league, etc.)
List<World> normalWorlds = Worlds.getAll(w ->
Worlds.isMembers(w) && Worlds.isNormal(w)
);
// Get a random world matching criteria
World randomWorld = Worlds.getRandom(w ->
Worlds.isMembers(w) && !Worlds.isHighRisk(w)
);
// Hop to a world
if (randomWorld != null) {
Worlds.hopTo(randomWorld);
}
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidCloses the world selection interface on the login lobby screen.static List<net.runelite.api.World> Gets all worlds matching the specified filter.static net.runelite.api.WorldGets the current world object.static intGets the current world ID.static net.runelite.api.WorldgetFirst(int id) Gets a world by its ID.static net.runelite.api.WorldGets the first world matching the specified filter.static net.runelite.api.WorldGets a random world matching the specified filter.static voidhopTo(net.runelite.api.World world) Hops to the specified world.static booleanChecks whether the player is currently in a members world.static booleanisAllPkWorld(net.runelite.api.World world) Checks whether the specified world is an all-PK (PvP everywhere) world.static booleanisBeta(net.runelite.api.World world) Checks whether the specified world is a beta world.static booleanisFreshStart(net.runelite.api.World world) Checks whether the specified world is a fresh start world.static booleanisHighRisk(net.runelite.api.World world) Checks whether the specified world is a high-risk world.static booleanChecks whether the world hopper interface is currently open.static booleanisLeague(net.runelite.api.World world) Checks whether the specified world is a league world.static booleanisMembers(net.runelite.api.World world) Checks whether the specified world is a members-only world.static booleanisNormal(net.runelite.api.World world) Checks whether the specified world is a normal world.static booleanisPvpArena(net.runelite.api.World world) Checks whether the specified world is a PvP Arena world.static booleanisQuestSpeedRunning(net.runelite.api.World world) Checks whether the specified world is a quest speedrunning world.static booleanisSkillTotal(net.runelite.api.World world) Checks whether the specified world has a skill total requirement.static booleanisSpeedrunning(net.runelite.api.World world) Checks whether the specified world is a speedrunning world.static booleanisTournament(net.runelite.api.World world) Checks whether the specified world is a tournament world.static voidLoads the world list from the server.static voidOpens the world hopper interface.static voidOpens the world selection interface on the login lobby screen.
-
Constructor Details
-
Worlds
public Worlds()
-
-
Method Details
-
inMembersWorld
public static boolean inMembersWorld()Checks whether the player is currently in a members world.- Returns:
trueif in a members world,falseotherwise
-
getAll
Gets all worlds matching the specified filter.- Parameters:
filter- the predicate to filter worlds- Returns:
- a list of
Worldobjects matching the filter
-
getFirst
Gets the first world matching the specified filter.- Parameters:
filter- the predicate to filter worlds- Returns:
- the first matching
World, ornullif none found
-
getFirst
public static net.runelite.api.World getFirst(int id) Gets a world by its ID.- Parameters:
id- the world ID (e.g., 301, 302)- Returns:
- the
Worldwith the specified ID, ornullif not found
-
getRandom
Gets a random world matching the specified filter.- Parameters:
filter- the predicate to filter worlds- Returns:
- a random matching
World, ornullif none found
-
getCurrentId
public static int getCurrentId()Gets the current world ID.- Returns:
- the current world number
-
getCurrent
public static net.runelite.api.World getCurrent()Gets the current world object.- Returns:
- the current
World
-
isHopperOpen
public static boolean isHopperOpen()Checks whether the world hopper interface is currently open.- Returns:
trueif the hopper is open,falseotherwise
-
hopTo
public static void hopTo(net.runelite.api.World world) Hops to the specified world. This will log the player out and back in to the new world.- Parameters:
world- theWorldto hop to
-
openHopper
public static void openHopper()Opens the world hopper interface. -
isMembers
public static boolean isMembers(net.runelite.api.World world) Checks whether the specified world is a members-only world.- Parameters:
world- theWorldto check- Returns:
trueif the world is members-only,falseotherwise
-
isAllPkWorld
public static boolean isAllPkWorld(net.runelite.api.World world) Checks whether the specified world is an all-PK (PvP everywhere) world.- Parameters:
world- theWorldto check- Returns:
trueif the world is all-PK,falseotherwise
-
isSkillTotal
public static boolean isSkillTotal(net.runelite.api.World world) Checks whether the specified world has a skill total requirement.- Parameters:
world- theWorldto check- Returns:
trueif the world requires a skill total,falseotherwise
-
isTournament
public static boolean isTournament(net.runelite.api.World world) Checks whether the specified world is a tournament world.- Parameters:
world- theWorldto check- Returns:
trueif the world is a tournament world,falseotherwise
-
isSpeedrunning
public static boolean isSpeedrunning(net.runelite.api.World world) Checks whether the specified world is a speedrunning world.- Parameters:
world- theWorldto check- Returns:
trueif the world is a speedrunning world,falseotherwise
-
isFreshStart
public static boolean isFreshStart(net.runelite.api.World world) Checks whether the specified world is a fresh start world.- Parameters:
world- theWorldto check- Returns:
trueif the world is a fresh start world,falseotherwise
-
isLeague
public static boolean isLeague(net.runelite.api.World world) Checks whether the specified world is a league world.- Parameters:
world- theWorldto check- Returns:
trueif the world is a league world,falseotherwise
-
isNormal
public static boolean isNormal(net.runelite.api.World world) Checks whether the specified world is a normal world. Normal worlds are standard game worlds without special restrictions or game modes.- Parameters:
world- theWorldto check- Returns:
trueif the world is normal,falseotherwise
-
isPvpArena
public static boolean isPvpArena(net.runelite.api.World world) Checks whether the specified world is a PvP Arena world.- Parameters:
world- theWorldto check- Returns:
trueif the world is a PvP Arena world,falseotherwise
-
isQuestSpeedRunning
public static boolean isQuestSpeedRunning(net.runelite.api.World world) Checks whether the specified world is a quest speedrunning world.- Parameters:
world- theWorldto check- Returns:
trueif the world is a quest speedrunning world,falseotherwise
-
isBeta
public static boolean isBeta(net.runelite.api.World world) Checks whether the specified world is a beta world.- Parameters:
world- theWorldto check- Returns:
trueif the world is a beta world,falseotherwise
-
isHighRisk
public static boolean isHighRisk(net.runelite.api.World world) Checks whether the specified world is a high-risk world. High-risk worlds have additional penalties on death.- Parameters:
world- theWorldto check- Returns:
trueif the world is high-risk,falseotherwise
-
loadWorlds
public static void loadWorlds()Loads the world list from the server. This should be called before querying worlds if the list may be stale. -
openLobbyWorlds
public static void openLobbyWorlds()Opens the world selection interface on the login lobby screen. -
closeLobbyWorlds
public static void closeLobbyWorlds()Closes the world selection interface on the login lobby screen.
-