Class Worlds

java.lang.Object
de.chojo.universalis.worlds.Worlds

public class Worlds extends Object
Class containing the currently valid regions, datacenters and worlds.
  • Constructor Details

    • Worlds

      public Worlds()
  • Method Details

    • europe

      public static Worlds.Europe europe()
      The european region
      Returns:
      europe region
    • northAmerica

      public static Worlds.NorthAmerica northAmerica()
      The north american region
      Returns:
      north american region
    • oceania

      public static Worlds.Oceania oceania()
      The oceanian region
      Returns:
      oceanian region
    • japan

      public static Worlds.Japan japan()
      The japanese region
      Returns:
      japanese region
    • china

      public static Worlds.China china()
      The 中国 region
      Returns:
      中国 region
    • regions

      public static List<Region> regions()
      Returns all valid regions
      Returns:
      unmodifiable list of regions
    • worldById

      public static World worldById(int id)
      Gets a world by its id.
      Parameters:
      id - world id
      Returns:
      world if valid or a dummy world with the matching ID
    • datacenterByName

      @Nullable @Contract("null -> null") public static @Nullable DataCenter datacenterByName(@Nullable @Nullable String name)
      Retrieves a data center by name
      Parameters:
      name - data center name case-insensitive
      Returns:
      data center
    • datacenterById

      @Nullable public static @Nullable DataCenter datacenterById(int id)
      Retrieves a data center by id
      Parameters:
      id - data center id
      Returns:
      data center
    • regionByName

      @Nullable @Contract("null -> null") public static @Nullable Region regionByName(@Nullable @Nullable String name)
      Retrieves a region by name
      Parameters:
      name - region name case-insensitive
      Returns:
      region
    • worldByName

      @Nullable @Contract("null -> null") public static @Nullable World worldByName(@Nullable @Nullable String name)
      Retrieve a world by its name
      Parameters:
      name - name case-insensitive
      Returns:
      world
    • toWorld

      public static World toWorld(World world)
      Transforms a world entity to an internal richer world model
      Parameters:
      world - world entity
      Returns:
      world