Class RegionManager.DimensionRegionApi

java.lang.Object
de.z0rdak.yawp.api.core.RegionManager.DimensionRegionApi
All Implemented Interfaces:
IDimensionRegionApi
Enclosing class:
RegionManager

public static class RegionManager.DimensionRegionApi extends Object implements IDimensionRegionApi
  • Method Details

    • save

      public void save()
      Specified by:
      save in interface IDimensionRegionApi
    • getLocalRegion

      public Optional<IMarkableRegion> getLocalRegion(String name)
      Specified by:
      getLocalRegion in interface IDimensionRegionApi
    • getDimKey

      public net.minecraft.resources.ResourceKey<net.minecraft.world.level.Level> getDimKey()
      Specified by:
      getDimKey in interface IDimensionRegionApi
    • getCache

      public LevelRegionData getCache()
      Specified by:
      getCache in interface IDimensionRegionApi
    • hasLocal

      public boolean hasLocal(String name)
      Description copied from interface: IDimensionRegionApi
      Test if a name is available for creating a local region
      Specified by:
      hasLocal in interface IDimensionRegionApi
      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
    • addLocalRegion

      public boolean addLocalRegion(IMarkableRegion region)
      Description copied from interface: IDimensionRegionApi
      Add a new Local Region providing the region itself
      Specified by:
      addLocalRegion in interface IDimensionRegionApi
      Parameters:
      region - the region to be added to the dimension and saved
      Returns:
      true if the Local Region was added successfully, false otherwise
    • removeLocal

      public boolean removeLocal(IMarkableRegion region)
      Description copied from interface: IDimensionRegionApi
      Remove the provided region from the dimension
      Specified by:
      removeLocal in interface IDimensionRegionApi
      Parameters:
      region - the region to be removed from the dimension and saved
      Returns:
      true if the Local Region was removed successfully, false otherwise
    • removeLocalRegion

      public boolean removeLocalRegion(String regionName)
      Description copied from interface: IDimensionRegionApi
      Remove the region identified by the provided region name from the dimension
      Specified by:
      removeLocalRegion in interface IDimensionRegionApi
      Parameters:
      regionName - the region to be removed from the dimension and saved
      Returns:
      true if the Local Region was removed successfully, false otherwise
    • hasRegionAt

      public boolean hasRegionAt(net.minecraft.core.BlockPos pos)
      Description copied from interface: IDimensionRegionApi
      Check if any regions exists at the given position
      Specified by:
      hasRegionAt in interface IDimensionRegionApi
      Parameters:
      pos - the position to check for regions
      Returns:
      true if any regions exist at the given position, false otherwise
    • getRegionsAt

      public List<IMarkableRegion> getRegionsAt(net.minecraft.core.BlockPos pos)
      Description copied from interface: IDimensionRegionApi
      Get all regions at the given position
      Specified by:
      getRegionsAt in interface IDimensionRegionApi
      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

      public Collection<IMarkableRegion> getAllLocalRegions()
      Specified by:
      getAllLocalRegions in interface IDimensionRegionApi
    • getRegionsIn

      public List<IMarkableRegion> getRegionsIn(net.minecraft.core.Vec3i pos1, net.minecraft.core.Vec3i pos2)
      Description copied from interface: IDimensionRegionApi
      Get all regions at the given Cuboid area defined by two Vec3i positions
      Specified by:
      getRegionsIn in interface IDimensionRegionApi
      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

      public List<IMarkableRegion> getRegionsInCoords(int x1, int y1, int z1, int x2, int y2, int z2)
      Description copied from interface: IDimensionRegionApi
      Get all regions inside the given Cuboid area, defined by the coordinates
      Specified by:
      getRegionsInCoords in interface IDimensionRegionApi
      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

      public List<IMarkableRegion> getRegionsInBox(net.minecraft.world.level.levelgen.structure.BoundingBox blockBox)
      Description copied from interface: IDimensionRegionApi
      Get all regions at the given AABB (AreaAlignedBlockBox - basically a Cuboid) area
      Specified by:
      getRegionsInBox in interface IDimensionRegionApi
      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

      public List<IMarkableRegion> getRegionsAround(net.minecraft.core.BlockPos pos, int radius)
      Specified by:
      getRegionsAround in interface IDimensionRegionApi
    • getIntersectingRegions

      public List<IMarkableRegion> getIntersectingRegions(net.minecraft.world.level.levelgen.structure.BoundingBox blockBox)
      Specified by:
      getIntersectingRegions in interface IDimensionRegionApi
    • getIntersectingRegions

      public List<IMarkableRegion> getIntersectingRegions(IMarkableRegion region)
      Description copied from interface: IDimensionRegionApi
      Returns all regions that intersect with the given region
      Specified by:
      getIntersectingRegions in interface IDimensionRegionApi
      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

      public List<IMarkableRegion> getContainingRegions(IMarkableRegion region)
      Description copied from interface: IDimensionRegionApi
      Returns all regions that contain the given region
      Specified by:
      getContainingRegions in interface IDimensionRegionApi
      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

      public List<IMarkableRegion> getContainedRegions(IMarkableRegion region)
      Description copied from interface: IDimensionRegionApi
      Returns all regions that are contained by the given region
      Specified by:
      getContainedRegions in interface IDimensionRegionApi
      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
    • getInvolvedRegionFor

      public 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.
      Specified by:
      getInvolvedRegionFor in interface IDimensionRegionApi
      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

      public Optional<IProtectedRegion> findResponsibleRegion(net.minecraft.core.BlockPos pos)
      Description copied from interface: IDimensionRegionApi
      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.
      Specified by:
      findResponsibleRegion in interface IDimensionRegionApi
      Parameters:
      pos - the position to get the responsible region for
      Returns:
      the responsible region for the given position and dimension