Package de.z0rdak.yawp.api.core
Interface IDimensionRegionApi
- All Known Implementing Classes:
RegionManager.DimensionRegionApi
public interface IDimensionRegionApi
-
Method Summary
Modifier and TypeMethodDescriptionbooleanaddLocalRegion(IMarkableRegion region) Add a new Local Region providing the region itselffindResponsibleRegion(net.minecraft.core.BlockPos pos) Gets the responsible region for the given position and dimension.getCache()getContainedRegions(IMarkableRegion region) Returns all regions that are contained by the given regiongetContainingRegions(IMarkableRegion region) Returns all regions that contain the given regionnet.minecraft.resources.ResourceKey<net.minecraft.world.level.Level> Returns all regions that intersect with the given regiongetIntersectingRegions(net.minecraft.world.level.levelgen.structure.BoundingBox blockBox) getInvolvedRegionFor(net.minecraft.core.BlockPos position) Gets the region with the highest priority among all involved regions at the given location and dimension.getLocalRegion(String name) getRegionsAround(net.minecraft.core.BlockPos pos, int radius) getRegionsAt(net.minecraft.core.BlockPos pos) Get all regions at the given positiongetRegionsIn(net.minecraft.core.Vec3i pos1, net.minecraft.core.Vec3i pos2) Get all regions at the given Cuboid area defined by two Vec3i positionsgetRegionsInBox(net.minecraft.world.level.levelgen.structure.BoundingBox blockBox) Get all regions at the given AABB (AreaAlignedBlockBox - basically a Cuboid) areagetRegionsInCoords(int x1, int y1, int z1, int x2, int y2, int z2) Get all regions inside the given Cuboid area, defined by the coordinatesbooleanTest if a name is available for creating a local regionbooleanhasRegionAt(net.minecraft.core.BlockPos pos) Check if any regions exists at the given positionbooleanremoveLocal(IMarkableRegion region) Remove the provided region from the dimensionbooleanremoveLocalRegion(String regionName) Remove the region identified by the provided region name from the dimensionvoidsave()
-
Method Details
-
save
void save() -
getLocalRegion
-
getDimKey
net.minecraft.resources.ResourceKey<net.minecraft.world.level.Level> getDimKey() -
getCache
LevelRegionData getCache() -
hasLocal
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
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
Get all regions at the given Cuboid area defined by two Vec3i positions- Parameters:
pos1- the first position of the cuboid areapos2- 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
Get all regions inside the given Cuboid area, defined by the coordinates- Parameters:
x1- xpos of the first blocky1- ypos of the first blockz1- zpos of the first blockx2- xpos of the second blocky2- ypos of the second blockz2- 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
-
getIntersectingRegions
List<IMarkableRegion> getIntersectingRegions(net.minecraft.world.level.levelgen.structure.BoundingBox blockBox) -
getIntersectingRegions
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
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
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
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
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
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
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
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
-