Interface IDimensionRegionApi

All Known Implementing Classes:
RegionManager.DimensionRegionApi

public interface IDimensionRegionApi
  • Method Details

    • save

      void save()
    • getLocalRegion

      Optional<IMarkableRegion> getLocalRegion(String name)
    • getDimKey

      net.minecraft.resources.ResourceKey<net.minecraft.world.level.Level> getDimKey()
    • getCache

      LevelRegionData getCache()
    • hasLocal

      boolean hasLocal(String name)
      Test if a name is available for creating a local region
      Parameters:
      name - the name of the new Local Region
      Returns:
      true if the name is suitable for creating a new region and is not taken, false otherwise
    • hasRegionAt

      boolean hasRegionAt(net.minecraft.core.BlockPos pos)
      Check if any regions exists at the given position
      Parameters:
      pos - the position to check for regions
      Returns:
      true if any regions exist at the given position, false otherwise
    • getRegionsAt

      List<IMarkableRegion> getRegionsAt(net.minecraft.core.BlockPos pos)
      Get all regions at the given position
      Parameters:
      pos - the position to check for regions
      Returns:
      a list of all regions at the given position, may be empty if no regions exist
    • getAllLocalRegions

      Collection<IMarkableRegion> getAllLocalRegions()
    • getRegionsIn

      List<IMarkableRegion> getRegionsIn(net.minecraft.core.Vec3i pos1, net.minecraft.core.Vec3i pos2)
      Get all regions at the given Cuboid area defined by two Vec3i positions
      Parameters:
      pos1 - the first position of the cuboid area
      pos2 - the second position of the cuboid area
      Returns:
      a list of all regions in the given cuboid area, may be empty if no regions exist
    • getRegionsInCoords

      List<IMarkableRegion> getRegionsInCoords(int x1, int y1, int z1, int x2, int y2, int z2)
      Get all regions inside the given Cuboid area, defined by the coordinates
      Parameters:
      x1 - xpos of the first block
      y1 - ypos of the first block
      z1 - zpos of the first block
      x2 - xpos of the second block
      y2 - ypos of the second block
      z2 - zpos of the second block
      Returns:
      a list of all regions in the given area, may be empty if no regions exist
    • getRegionsInBox

      List<IMarkableRegion> getRegionsInBox(net.minecraft.world.level.levelgen.structure.BoundingBox blockBox)
      Get all regions at the given AABB (AreaAlignedBlockBox - basically a Cuboid) area
      Parameters:
      blockBox - the AABB area to check for regions
      Returns:
      a list of all regions in the given AABB area, may be empty if no regions exist
    • getRegionsAround

      List<IMarkableRegion> getRegionsAround(net.minecraft.core.BlockPos pos, int radius)
    • getIntersectingRegions

      List<IMarkableRegion> getIntersectingRegions(net.minecraft.world.level.levelgen.structure.BoundingBox blockBox)
    • getIntersectingRegions

      List<IMarkableRegion> getIntersectingRegions(IMarkableRegion region)
      Returns all regions that intersect with the given region
      Parameters:
      region - the region to check for intersections
      Returns:
      a list of all regions that intersect with the given region, may be empty if no regions intersect
    • getContainingRegions

      List<IMarkableRegion> getContainingRegions(IMarkableRegion region)
      Returns all regions that contain the given region
      Parameters:
      region - the region to check for containing regions
      Returns:
      a list of all regions that contain the given region, may be empty if no regions contain the given region
    • getContainedRegions

      List<IMarkableRegion> getContainedRegions(IMarkableRegion region)
      Returns all regions that are contained by the given region
      Parameters:
      region - the region to check for contained regions
      Returns:
      a list of all regions that are contained by the given region, may be empty if no regions are contained by the given region
    • addLocalRegion

      boolean addLocalRegion(IMarkableRegion region)
      Add a new Local Region providing the region itself
      Parameters:
      region - the region to be added to the dimension and saved
      Returns:
      true if the Local Region was added successfully, false otherwise
    • removeLocal

      boolean removeLocal(IMarkableRegion region)
      Remove the provided region from the dimension
      Parameters:
      region - the region to be removed from the dimension and saved
      Returns:
      true if the Local Region was removed successfully, false otherwise
    • removeLocalRegion

      boolean removeLocalRegion(String regionName)
      Remove the region identified by the provided region name from the dimension
      Parameters:
      regionName - the region to be removed from the dimension and saved
      Returns:
      true if the Local Region was removed successfully, false otherwise
    • getInvolvedRegionFor

      Optional<IMarkableRegion> getInvolvedRegionFor(net.minecraft.core.BlockPos position)
      Gets the region with the highest priority among all involved regions at the given location and dimension.
      This considers the active state of the region as well.
      Parameters:
      position - the position to check for involved regions
      Returns:
      the region with the highest priority among all involved regions which contain the given location
    • findResponsibleRegion

      Optional<IProtectedRegion> findResponsibleRegion(net.minecraft.core.BlockPos pos)
      Gets the responsible region for the given position and dimension.
      The responsible region is the region with the highest priority among all involved regions at the given location and dimension.
      Parameters:
      pos - the position to get the responsible region for
      Returns:
      the responsible region for the given position and dimension