Class CuboidImpl
java.lang.Object
sawfowl.regionguard.implementsapi.data.CuboidImpl
- All Implemented Interfaces:
org.spongepowered.api.data.persistence.DataSerializable
,Cuboid
-
Nested Class Summary
Nested classes/interfaces inherited from interface sawfowl.regionguard.api.data.Cuboid
Cuboid.Builder
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbuilder()
boolean
containsIntersectsPosition
(org.spongepowered.math.vector.Vector3i vector3i) Checking for a position in the areaint
void
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 positionsetPositions
(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.org.spongepowered.api.data.persistence.DataContainer
toFlat
(org.spongepowered.api.world.server.ServerWorld world) Changing the positions of the cuboid according to the height of the world.
-
Constructor Details
-
CuboidImpl
public CuboidImpl()
-
-
Method Details
-
builder
-
getAllPositions
Description copied from interface:Cuboid
Getting all positions in the cuboid.- Specified by:
getAllPositions
in interfaceCuboid
-
getPositionsXZ
Description copied from interface:Cuboid
Getting all positions in the cuboid. Excludes the Y-axis.- Specified by:
getPositionsXZ
in interfaceCuboid
-
setPositions
public Cuboid setPositions(org.spongepowered.math.vector.Vector3i position1, org.spongepowered.math.vector.Vector3i position2, SelectorTypes selectorType, org.spongepowered.api.world.server.ServerWorld world) Description copied from interface:Cuboid
Setting positions at the cuboid.- Specified by:
setPositions
in interfaceCuboid
- Parameters:
position1
- - first positionposition2
- - second positionselectorType
- - flat or cuboid
-
getSelectorType
Description copied from interface:Cuboid
Get the type of area selection.- Specified by:
getSelectorType
in interfaceCuboid
-
setSelectorType
Description copied from interface:Cuboid
Set the type of area selection.- Specified by:
setSelectorType
in interfaceCuboid
-
getAABB
public org.spongepowered.api.util.AABB getAABB()Description copied from interface:Cuboid
Get AABB -
getCenter
public org.spongepowered.math.vector.Vector3d getCenter()Description copied from interface:Cuboid
Get the center position of the selection. -
getSizeXYZ
public org.spongepowered.math.vector.Vector3d getSizeXYZ()Description copied from interface:Cuboid
Get the sizes of the area by three coordinates- Specified by:
getSizeXYZ
in interfaceCuboid
-
getSizeXZ
public int[] getSizeXZ()Description copied from interface:Cuboid
Get the sizes of the area by two coordinates -
getSize3D
public long getSize3D()Description copied from interface:Cuboid
Obtaining the volume of the area, taking into account all three coordinate axes. -
getSize2D
public long getSize2D()Description copied from interface:Cuboid
Obtaining the volume of the area with only XY coordinates. -
getSize
public long getSize()Description copied from interface:Cuboid
Obtaining the volume of an area depending on its type. -
expand
public void expand(int x, int y, int z) Description copied from interface:Cuboid
Expanding area -
contract
public void contract(int x, int y, int z) Description copied from interface:Cuboid
Decreasing area -
containsIntersectsPosition
public boolean containsIntersectsPosition(org.spongepowered.math.vector.Vector3i vector3i) Description copied from interface:Cuboid
Checking for a position in the area- Specified by:
containsIntersectsPosition
in interfaceCuboid
- Parameters:
vector3i
- - Checkable position.- Returns:
- - true if contains
- false if not contains
-
getMin
public org.spongepowered.math.vector.Vector3i getMin()Description copied from interface:Cuboid
Getting the minimum position -
getMax
public org.spongepowered.math.vector.Vector3i getMax()Description copied from interface:Cuboid
Getting the maximum position -
getOppositeCorner
public org.spongepowered.math.vector.Vector3i getOppositeCorner(org.spongepowered.math.vector.Vector3i vector3i) Description copied from interface:Cuboid
Obtaining the opposite corner of area.- Specified by:
getOppositeCorner
in interfaceCuboid
- 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
Description copied from interface:Cuboid
Getting all corner positions of the area- Specified by:
getAllCorners
in interfaceCuboid
-
isCorner
public boolean isCorner(org.spongepowered.math.vector.Vector3i vector3i) Description copied from interface:Cuboid
Checking if the position is a corner position -
toFlat
Description copied from interface:Cuboid
Changing the positions of the cuboid according to the height of the world. -
contentVersion
public int contentVersion()- Specified by:
contentVersion
in interfaceorg.spongepowered.api.data.persistence.DataSerializable
-
toContainer
public org.spongepowered.api.data.persistence.DataContainer toContainer()- Specified by:
toContainer
in interfaceorg.spongepowered.api.data.persistence.DataSerializable
-