Interface RegionisedWorld

All Superinterfaces:
RegionQuery.Position.Queryable
All Known Implementing Classes:
RegionisedWorldSet

public sealed interface RegionisedWorld extends RegionQuery.Position.Queryable permits RegionisedWorldSet
Represents a world that contains a set of Regions.

Several methods are provided through applicable RegionQuery subclasses to allow specific queries for regions.

  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    add(Region region)
    Attempts to add a region to this world.
    getByName(String regionName)
    Gets a region by the specified name, if it is present.
    Gets the set of regions within this regionised world.
    boolean
    remove(Region region)
    Attempts to remove a region from this world.
    Optional<net.kyori.adventure.key.Key>
    Gets the key of the world this represents.

    Methods inherited from interface org.empirewar.orbis.query.RegionQuery.Position.Queryable

    query, query
  • Method Details

    • worldId

      Optional<net.kyori.adventure.key.Key> worldId()
      Gets the key of the world this represents.

      This method may return an empty optional if this is a "global holder" of all regions.

      Returns:
      key of world this represents
    • regions

      Set<Region> regions()
      Gets the set of regions within this regionised world.
      Returns:
      all regions within this world
    • getByName

      Optional<Region> getByName(String regionName)
      Gets a region by the specified name, if it is present.
      Parameters:
      regionName - the region name
      Returns:
      an optional with the region if present, else Optional.empty()
    • add

      boolean add(Region region)
      Attempts to add a region to this world.
      Parameters:
      region - the region to add
      Returns:
      false if the region is already attached to this world
    • remove

      boolean remove(Region region)
      Attempts to remove a region from this world.
      Parameters:
      region - the region to remove
      Returns:
      true if the region was present and was successfully removed