Package sawfowl.regionguard.api.data
Interface Cuboid
- All Superinterfaces:
org.spongepowered.api.data.persistence.DataSerializable
- All Known Implementing Classes:
CuboidImpl
@ConfigSerializable
public interface Cuboid
extends org.spongepowered.api.data.persistence.DataSerializable
-
Nested Class Summary
Nested Classes -
Method Summary
Modifier and TypeMethodDescriptionstatic Cuboid.Builder
builder()
static Cuboid.Builder
builder
(SelectorTypes type) boolean
containsIntersectsPosition
(org.spongepowered.math.vector.Vector3i vector3i) Checking for a position in the areavoid
contract
(int x, int y, int z) Decreasing areavoid
expand
(int x, int y, int z) Expanding areaorg.spongepowered.api.util.AABB
getAABB()
Get AABBList<org.spongepowered.math.vector.Vector3i>
Getting all corner positions of the areaList<org.spongepowered.math.vector.Vector3i>
Getting all positions in the cuboid.org.spongepowered.math.vector.Vector3d
Get the center position of the selection.org.spongepowered.math.vector.Vector3i
getMax()
Getting the maximum positionorg.spongepowered.math.vector.Vector3i
getMin()
Getting the minimum positionorg.spongepowered.math.vector.Vector3i
getOppositeCorner
(org.spongepowered.math.vector.Vector3i vector3i) Obtaining the opposite corner of area.List<org.spongepowered.math.vector.Vector2i>
Getting all positions in the cuboid.Get the type of area selection.long
getSize()
Obtaining the volume of an area depending on its type.long
Obtaining the volume of the area with only XY coordinates.long
Obtaining the volume of the area, taking into account all three coordinate axes.org.spongepowered.math.vector.Vector3d
Get the sizes of the area by three coordinatesint[]
Get the sizes of the area by two coordinatesboolean
isCorner
(org.spongepowered.math.vector.Vector3i vector3i) Checking if the position is a corner positionstatic Cuboid
of
(org.spongepowered.api.util.AABB aabb) static Cuboid
of
(org.spongepowered.math.vector.Vector3i first, org.spongepowered.math.vector.Vector3i second) static Cuboid
of
(SelectorTypes type, org.spongepowered.api.util.AABB aabb) static Cuboid
of
(SelectorTypes type, org.spongepowered.math.vector.Vector3i first, org.spongepowered.math.vector.Vector3i second) setPositions
(org.spongepowered.math.vector.Vector3i position1, org.spongepowered.math.vector.Vector3i position2, SelectorTypes selectorType, org.spongepowered.api.world.server.ServerWorld world) Setting positions at the cuboid.void
setSelectorType
(SelectorTypes selectorType) Set the type of area selection.toFlat
(org.spongepowered.api.world.server.ServerWorld world) Changing the positions of the cuboid according to the height of the world.Methods inherited from interface org.spongepowered.api.data.persistence.DataSerializable
contentVersion, toContainer
-
Method Details
-
builder
-
builder
-
of
static Cuboid of(SelectorTypes type, org.spongepowered.math.vector.Vector3i first, org.spongepowered.math.vector.Vector3i second) -
of
static Cuboid of(org.spongepowered.math.vector.Vector3i first, org.spongepowered.math.vector.Vector3i second) -
of
-
of
-
getAllPositions
List<org.spongepowered.math.vector.Vector3i> getAllPositions()Getting all positions in the cuboid. -
getPositionsXZ
List<org.spongepowered.math.vector.Vector2i> getPositionsXZ()Getting all positions in the cuboid. Excludes the Y-axis. -
setPositions
Cuboid setPositions(org.spongepowered.math.vector.Vector3i position1, org.spongepowered.math.vector.Vector3i position2, SelectorTypes selectorType, org.spongepowered.api.world.server.ServerWorld world) Setting positions at the cuboid.- Parameters:
position1
- - first positionposition2
- - second positionselectorType
- - flat or cuboid
-
getSelectorType
SelectorTypes getSelectorType()Get the type of area selection. -
setSelectorType
Set the type of area selection. -
getAABB
org.spongepowered.api.util.AABB getAABB()Get AABB -
getCenter
org.spongepowered.math.vector.Vector3d getCenter()Get the center position of the selection. -
getSizeXYZ
org.spongepowered.math.vector.Vector3d getSizeXYZ()Get the sizes of the area by three coordinates -
getSizeXZ
int[] getSizeXZ()Get the sizes of the area by two coordinates -
getSize3D
long getSize3D()Obtaining the volume of the area, taking into account all three coordinate axes. -
getSize2D
long getSize2D()Obtaining the volume of the area with only XY coordinates. -
getSize
long getSize()Obtaining the volume of an area depending on its type. -
expand
void expand(int x, int y, int z) Expanding area -
contract
void contract(int x, int y, int z) Decreasing area -
containsIntersectsPosition
boolean containsIntersectsPosition(org.spongepowered.math.vector.Vector3i vector3i) Checking for a position in the area- Parameters:
vector3i
- - Checkable position.- Returns:
- - true if contains
- false if not contains
-
getMin
org.spongepowered.math.vector.Vector3i getMin()Getting the minimum position -
getMax
org.spongepowered.math.vector.Vector3i getMax()Getting the maximum position -
getOppositeCorner
org.spongepowered.math.vector.Vector3i getOppositeCorner(org.spongepowered.math.vector.Vector3i vector3i) Obtaining the opposite corner of area.- Parameters:
vector3i
- - Position for the search- Returns:
- - position for the search if position is not corner
- position in the opposite corner according to the type of area
-
getAllCorners
List<org.spongepowered.math.vector.Vector3i> getAllCorners()Getting all corner positions of the area -
isCorner
boolean isCorner(org.spongepowered.math.vector.Vector3i vector3i) Checking if the position is a corner position- Parameters:
vector3i
- - checked position- Returns:
- - true if position is corner
- false if position isn't corner
-
toFlat
Changing the positions of the cuboid according to the height of the world.
-