Package de.z0rdak.yawp.api.core
Class RegionManager.DimensionRegionApi
java.lang.Object
de.z0rdak.yawp.api.core.RegionManager.DimensionRegionApi
- All Implemented Interfaces:
IDimensionRegionApi
- 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 interfaceIDimensionRegionApi
-
getLocalRegion
- Specified by:
getLocalRegionin interfaceIDimensionRegionApi
-
getDimKey
public net.minecraft.resources.ResourceKey<net.minecraft.world.level.Level> getDimKey()- Specified by:
getDimKeyin interfaceIDimensionRegionApi
-
getCache
- Specified by:
getCachein interfaceIDimensionRegionApi
-
hasLocal
Description copied from interface:IDimensionRegionApiTest if a name is available for creating a local region- Specified by:
hasLocalin interfaceIDimensionRegionApi- 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:IDimensionRegionApiAdd a new Local Region providing the region itself- Specified by:
addLocalRegionin interfaceIDimensionRegionApi- 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:IDimensionRegionApiRemove the provided region from the dimension- Specified by:
removeLocalin interfaceIDimensionRegionApi- 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:IDimensionRegionApiRemove the region identified by the provided region name from the dimension- Specified by:
removeLocalRegionin interfaceIDimensionRegionApi- 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:IDimensionRegionApiCheck if any regions exists at the given position- Specified by:
hasRegionAtin interfaceIDimensionRegionApi- 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:IDimensionRegionApiGet all regions at the given position- Specified by:
getRegionsAtin interfaceIDimensionRegionApi- 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 interfaceIDimensionRegionApi
-
getRegionsIn
public List<IMarkableRegion> getRegionsIn(net.minecraft.core.Vec3i pos1, net.minecraft.core.Vec3i pos2) Description copied from interface:IDimensionRegionApiGet all regions at the given Cuboid area defined by two Vec3i positions- Specified by:
getRegionsInin interfaceIDimensionRegionApi- 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:IDimensionRegionApiGet all regions inside the given Cuboid area, defined by the coordinates- Specified by:
getRegionsInCoordsin interfaceIDimensionRegionApi- 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:IDimensionRegionApiGet all regions at the given AABB (AreaAlignedBlockBox - basically a Cuboid) area- Specified by:
getRegionsInBoxin interfaceIDimensionRegionApi- 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 interfaceIDimensionRegionApi
-
getIntersectingRegions
public List<IMarkableRegion> getIntersectingRegions(net.minecraft.world.level.levelgen.structure.BoundingBox blockBox) - Specified by:
getIntersectingRegionsin interfaceIDimensionRegionApi
-
getIntersectingRegions
Description copied from interface:IDimensionRegionApiReturns all regions that intersect with the given region- Specified by:
getIntersectingRegionsin interfaceIDimensionRegionApi- 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:IDimensionRegionApiReturns all regions that contain the given region- Specified by:
getContainingRegionsin interfaceIDimensionRegionApi- 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:IDimensionRegionApiReturns all regions that are contained by the given region- Specified by:
getContainedRegionsin interfaceIDimensionRegionApi- 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 interfaceIDimensionRegionApi- 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:IDimensionRegionApiGets 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 interfaceIDimensionRegionApi- Parameters:
pos- the position to get the responsible region for- Returns:
- the responsible region for the given position and dimension
-