Class RegionManager.DimensionRegionApi
java.lang.Object
de.z0rdak.yawp.api.core.RegionManager.DimensionRegionApi
- All Implemented Interfaces:
ILevelRegionApi
- Enclosing class:
RegionManager
-
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
public void save()- Specified by:
savein interfaceILevelRegionApi
-
getLocalRegion
- Specified by:
getLocalRegionin interfaceILevelRegionApi
-
getDimKey
public net.minecraft.resources.ResourceKey<net.minecraft.world.level.Level> getDimKey()- Specified by:
getDimKeyin interfaceILevelRegionApi
-
getCache
- Specified by:
getCachein interfaceILevelRegionApi
-
hasLocal
Description copied from interface:ILevelRegionApiTest if a name is available for creating a local region- Specified by:
hasLocalin interfaceILevelRegionApi- 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
Description copied from interface:ILevelRegionApiAdd a new Local Region providing the region itself- Specified by:
addLocalRegionin interfaceILevelRegionApi- Parameters:
region- the region to be added to the dimension and saved- Returns:
- true if the Local Region was added successfully, false otherwise
-
removeLocal
Description copied from interface:ILevelRegionApiRemove the provided region from the dimension- Specified by:
removeLocalin interfaceILevelRegionApi- Parameters:
region- the region to be removed from the dimension and saved- Returns:
- true if the Local Region was removed successfully, false otherwise
-
removeLocalRegion
Description copied from interface:ILevelRegionApiRemove the region identified by the provided region name from the dimension- Specified by:
removeLocalRegionin interfaceILevelRegionApi- 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:ILevelRegionApiCheck if any regions exists at the given position- Specified by:
hasRegionAtin interfaceILevelRegionApi- Parameters:
pos- the position to check for regions- Returns:
- true if any regions exist at the given position, false otherwise
-
getRegionsAt
Description copied from interface:ILevelRegionApiGet all regions at the given position- Specified by:
getRegionsAtin interfaceILevelRegionApi- 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
- Specified by:
getAllLocalRegionsin interfaceILevelRegionApi
-
getRegionsIn
public List<IMarkableRegion> getRegionsIn(net.minecraft.core.Vec3i pos1, net.minecraft.core.Vec3i pos2) Description copied from interface:ILevelRegionApiGet all regions at the given Cuboid area defined by two Vec3i positions- Specified by:
getRegionsInin interfaceILevelRegionApi- 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
Description copied from interface:ILevelRegionApiGet all regions inside the given Cuboid area, defined by the coordinates- Specified by:
getRegionsInCoordsin interfaceILevelRegionApi- 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
public List<IMarkableRegion> getRegionsInBox(net.minecraft.world.level.levelgen.structure.BoundingBox blockBox) Description copied from interface:ILevelRegionApiGet all regions at the given AABB (AreaAlignedBlockBox - basically a Cuboid) area- Specified by:
getRegionsInBoxin interfaceILevelRegionApi- 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
- Specified by:
getRegionsAroundin interfaceILevelRegionApi
-
getIntersectingRegions
public List<IMarkableRegion> getIntersectingRegions(net.minecraft.world.level.levelgen.structure.BoundingBox blockBox) - Specified by:
getIntersectingRegionsin interfaceILevelRegionApi
-
getIntersectingRegions
Description copied from interface:ILevelRegionApiReturns all regions that intersect with the given region- Specified by:
getIntersectingRegionsin interfaceILevelRegionApi- 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
Description copied from interface:ILevelRegionApiReturns all regions that contain the given region- Specified by:
getContainingRegionsin interfaceILevelRegionApi- 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
Description copied from interface:ILevelRegionApiReturns all regions that are contained by the given region- Specified by:
getContainedRegionsin interfaceILevelRegionApi- 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
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:
getInvolvedRegionForin interfaceILevelRegionApi- 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
Description copied from interface:ILevelRegionApiGets 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:
findResponsibleRegionin interfaceILevelRegionApi- Parameters:
pos- the position to get the responsible region for- Returns:
- the responsible region for the given position and dimension
-