Class Worlds

java.lang.Object
net.storm.sdk.game.Worlds

public class Worlds extends Object
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:
  • World
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static void
    Closes the world selection interface on the login lobby screen.
    static List<net.runelite.api.World>
    getAll(Predicate<net.runelite.api.World> filter)
    Gets all worlds matching the specified filter.
    static net.runelite.api.World
    Gets the current world object.
    static int
    Gets the current world ID.
    static net.runelite.api.World
    getFirst(int id)
    Gets a world by its ID.
    static net.runelite.api.World
    getFirst(Predicate<net.runelite.api.World> filter)
    Gets the first world matching the specified filter.
    static net.runelite.api.World
    getRandom(Predicate<net.runelite.api.World> filter)
    Gets a random world matching the specified filter.
    static void
    hopTo(net.runelite.api.World world)
    Hops to the specified world.
    static boolean
    Checks whether the player is currently in a members world.
    static boolean
    isAllPkWorld(net.runelite.api.World world)
    Checks whether the specified world is an all-PK (PvP everywhere) world.
    static boolean
    isBeta(net.runelite.api.World world)
    Checks whether the specified world is a beta world.
    static boolean
    isFreshStart(net.runelite.api.World world)
    Checks whether the specified world is a fresh start world.
    static boolean
    isHighRisk(net.runelite.api.World world)
    Checks whether the specified world is a high-risk world.
    static boolean
    Checks whether the world hopper interface is currently open.
    static boolean
    isLeague(net.runelite.api.World world)
    Checks whether the specified world is a league world.
    static boolean
    isMembers(net.runelite.api.World world)
    Checks whether the specified world is a members-only world.
    static boolean
    isNormal(net.runelite.api.World world)
    Checks whether the specified world is a normal world.
    static boolean
    isPvpArena(net.runelite.api.World world)
    Checks whether the specified world is a PvP Arena world.
    static boolean
    isQuestSpeedRunning(net.runelite.api.World world)
    Checks whether the specified world is a quest speedrunning world.
    static boolean
    isSkillTotal(net.runelite.api.World world)
    Checks whether the specified world has a skill total requirement.
    static boolean
    isSpeedrunning(net.runelite.api.World world)
    Checks whether the specified world is a speedrunning world.
    static boolean
    isTournament(net.runelite.api.World world)
    Checks whether the specified world is a tournament world.
    static void
    Loads the world list from the server.
    static void
    Opens the world hopper interface.
    static void
    Opens the world selection interface on the login lobby screen.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • Worlds

      public Worlds()
  • Method Details

    • inMembersWorld

      public static boolean inMembersWorld()
      Checks whether the player is currently in a members world.
      Returns:
      true if in a members world, false otherwise
    • getAll

      public static List<net.runelite.api.World> getAll(Predicate<net.runelite.api.World> filter)
      Gets all worlds matching the specified filter.
      Parameters:
      filter - the predicate to filter worlds
      Returns:
      a list of World objects matching the filter
    • getFirst

      public static net.runelite.api.World getFirst(Predicate<net.runelite.api.World> filter)
      Gets the first world matching the specified filter.
      Parameters:
      filter - the predicate to filter worlds
      Returns:
      the first matching World, or null if 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 World with the specified ID, or null if not found
    • getRandom

      public static net.runelite.api.World getRandom(Predicate<net.runelite.api.World> filter)
      Gets a random world matching the specified filter.
      Parameters:
      filter - the predicate to filter worlds
      Returns:
      a random matching World, or null if 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:
      true if the hopper is open, false otherwise
    • 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 - the World to 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 - the World to check
      Returns:
      true if the world is members-only, false otherwise
    • isAllPkWorld

      public static boolean isAllPkWorld(net.runelite.api.World world)
      Checks whether the specified world is an all-PK (PvP everywhere) world.
      Parameters:
      world - the World to check
      Returns:
      true if the world is all-PK, false otherwise
    • isSkillTotal

      public static boolean isSkillTotal(net.runelite.api.World world)
      Checks whether the specified world has a skill total requirement.
      Parameters:
      world - the World to check
      Returns:
      true if the world requires a skill total, false otherwise
    • isTournament

      public static boolean isTournament(net.runelite.api.World world)
      Checks whether the specified world is a tournament world.
      Parameters:
      world - the World to check
      Returns:
      true if the world is a tournament world, false otherwise
    • isSpeedrunning

      public static boolean isSpeedrunning(net.runelite.api.World world)
      Checks whether the specified world is a speedrunning world.
      Parameters:
      world - the World to check
      Returns:
      true if the world is a speedrunning world, false otherwise
    • isFreshStart

      public static boolean isFreshStart(net.runelite.api.World world)
      Checks whether the specified world is a fresh start world.
      Parameters:
      world - the World to check
      Returns:
      true if the world is a fresh start world, false otherwise
    • isLeague

      public static boolean isLeague(net.runelite.api.World world)
      Checks whether the specified world is a league world.
      Parameters:
      world - the World to check
      Returns:
      true if the world is a league world, false otherwise
    • 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 - the World to check
      Returns:
      true if the world is normal, false otherwise
    • isPvpArena

      public static boolean isPvpArena(net.runelite.api.World world)
      Checks whether the specified world is a PvP Arena world.
      Parameters:
      world - the World to check
      Returns:
      true if the world is a PvP Arena world, false otherwise
    • isQuestSpeedRunning

      public static boolean isQuestSpeedRunning(net.runelite.api.World world)
      Checks whether the specified world is a quest speedrunning world.
      Parameters:
      world - the World to check
      Returns:
      true if the world is a quest speedrunning world, false otherwise
    • isBeta

      public static boolean isBeta(net.runelite.api.World world)
      Checks whether the specified world is a beta world.
      Parameters:
      world - the World to check
      Returns:
      true if the world is a beta world, false otherwise
    • 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 - the World to check
      Returns:
      true if the world is high-risk, false otherwise
    • 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.