Class Worlds


  • public class Worlds
    extends java.lang.Object
    This class provides various methods for interacting with the Worlds.
    • Constructor Summary

      Constructors 
      Constructor Description
      Worlds()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static java.util.List<World> all()
      Retrieves all the worlds.
      static java.util.List<World> all​(java.util.function.Predicate<World> predicate)
      Returns a list of all the Worlds that satisfy the given predicate.
      static java.util.List<World> f2p()
      Returns a list of "f2p" worlds.
      static int getCurrentWorld()
      Returns the current world number.
      static World getMyWorld()
      Returns the current world that matches the ID of the current world.
      static java.util.List<World> getNormalizedWorlds()
      Returns a list of "normalized" worlds.
      static World getRandomWorld()
      Returns a random World from the list of available worlds.
      static World getRandomWorld​(java.util.function.Predicate<World> predicate)
      Returns a randomly selected World that satisfies the given predicate.
      static World getRandomWorld​(java.util.List<World> worlds)
      Returns a random World from the given list of Worlds.
      static World getWorld​(int worldID)
      Returns the World with the given worldID, or null if not found.
      static World getWorld​(java.util.function.Predicate<World> predicate)
      Returns the first instance of a World that matches the given predicate, or null if no match is found.
      static int getWorldId()
      Retrieves the current world ID.
      static java.util.List<World> highRisk()
      Returns a list of "high risk" worlds.
      static boolean isWorldsLoaded()
      Checks if the worlds are loaded.
      static java.util.List<World> members()
      Returns a list of "members" worlds.
      static java.util.List<World> noMinimumLevel()
      Returns a list of worlds with no minimum level requirement.
      static java.util.List<World> noSaveMode()
      Returns a list of "no save mode" worlds.
      static java.util.List<World> pvp()
      Returns a list of "pvp" worlds.
      static java.util.List<World> pvpArena()
      Returns a list of "pvp arena" worlds.
      static boolean setWorld​(int worldID)
      Sets the current world by its ID.
      static boolean setWorld​(World world)
      Sets the given world as the current world.
      • Methods inherited from class java.lang.Object

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

      • Worlds

        public Worlds()
    • Method Detail

      • getWorldId

        public static int getWorldId()
        Retrieves the current world ID.
        Returns:
        the world ID as an integer value.
      • isWorldsLoaded

        public static boolean isWorldsLoaded()
        Checks if the worlds are loaded.
        Returns:
        true if the worlds are loaded, false otherwise.
      • all

        public static java.util.List<World> all()
        Retrieves all the worlds.
        Returns:
        a list of all the worlds
      • all

        public static java.util.List<World> all​(java.util.function.Predicate<World> predicate)
        Returns a list of all the Worlds that satisfy the given predicate. If the predicate is null, an empty list is returned.
        Parameters:
        predicate - the condition to be satisfied by the Worlds
        Returns:
        a list of Worlds that satisfy the predicate
      • setWorld

        public static boolean setWorld​(int worldID)
        Sets the current world by its ID.
        Parameters:
        worldID - the ID of the world to be set
        Returns:
        true if the world is set successfully, false otherwise
      • setWorld

        public static boolean setWorld​(World world)
        Sets the given world as the current world.
        Parameters:
        world - the world to set
        Returns:
        true if the world was successfully set, false otherwise
      • getRandomWorld

        public static World getRandomWorld()
        Returns a random World from the list of available worlds.
        Returns:
        a random World, or null if no worlds are available
      • getRandomWorld

        public static World getRandomWorld​(java.util.function.Predicate<World> predicate)
        Returns a randomly selected World that satisfies the given predicate.
        Parameters:
        predicate - a predicate to filter the worlds
        Returns:
        a randomly selected World, or null if no worlds meet the predicate criteria
      • getRandomWorld

        public static World getRandomWorld​(java.util.List<World> worlds)
        Returns a random World from the given list of Worlds.
        Parameters:
        worlds - the list of Worlds to choose from
        Returns:
        a random World from the list, or null if the list is empty
      • getWorld

        public static World getWorld​(java.util.function.Predicate<World> predicate)
        Returns the first instance of a World that matches the given predicate, or null if no match is found.
        Parameters:
        predicate - the condition to match a World
        Returns:
        the first matching World, or null if no match is found
      • getWorld

        public static World getWorld​(int worldID)
        Returns the World with the given worldID, or null if not found.
        Parameters:
        worldID - the ID of the World to retrieve
        Returns:
        the World with the specified worldID, or null if not found
      • getNormalizedWorlds

        public static java.util.List<World> getNormalizedWorlds()
        Returns a list of "normalized" worlds.
        Returns:
        a list of "normalized" worlds
      • highRisk

        public static java.util.List<World> highRisk()
        Returns a list of "high risk" worlds.
        Returns:
        a list of "high risk" worlds
      • f2p

        public static java.util.List<World> f2p()
        Returns a list of "f2p" worlds.
        Returns:
        a list of "f2p" worlds
      • members

        public static java.util.List<World> members()
        Returns a list of "members" worlds.
        Returns:
        a list of "members" worlds
      • noMinimumLevel

        public static java.util.List<World> noMinimumLevel()
        Returns a list of worlds with no minimum level requirement.
        Returns:
        a list of worlds with no minimum level requirement
      • pvp

        public static java.util.List<World> pvp()
        Returns a list of "pvp" worlds.
        Returns:
        a list of "pvp" worlds
      • pvpArena

        public static java.util.List<World> pvpArena()
        Returns a list of "pvp arena" worlds.
        Returns:
        a list of "pvp arena" worlds
      • noSaveMode

        public static java.util.List<World> noSaveMode()
        Returns a list of "no save mode" worlds.
        Returns:
        a list of "no save mode" worlds
      • getCurrentWorld

        public static int getCurrentWorld()
        Returns the current world number.
        Returns:
        the current world number
      • getMyWorld

        public static World getMyWorld()
        Returns the current world that matches the ID of the current world.
        Returns:
        the World that matches the ID of the current world, or null if not found.