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()booleancontainsIntersectsPosition(org.spongepowered.math.vector.Vector3i vector3i) Checking for a position in the areaintvoidcontract(int x, int y, int z) Decreasing areavoidexpand(int x, int y, int z) Expanding areaorg.spongepowered.api.util.AABBgetAABB()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.Vector3dGet the center position of the selection.org.spongepowered.math.vector.Vector3igetMax()Getting the maximum positionorg.spongepowered.math.vector.Vector3igetMin()Getting the minimum positionorg.spongepowered.math.vector.Vector3igetOppositeCorner(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.longgetSize()Obtaining the volume of an area depending on its type.longObtaining the volume of the area with only XY coordinates.longObtaining the volume of the area, taking into account all three coordinate axes.org.spongepowered.math.vector.Vector3dGet the sizes of the area by three coordinatesint[]Get the sizes of the area by two coordinatesbooleanisCorner(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.voidsetSelectorType(SelectorTypes selectorType) Set the type of area selection.org.spongepowered.api.data.persistence.DataContainertoFlat(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:CuboidGetting all positions in the cuboid.- Specified by:
getAllPositionsin interfaceCuboid
-
getPositionsXZ
Description copied from interface:CuboidGetting all positions in the cuboid. Excludes the Y-axis.- Specified by:
getPositionsXZin 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:CuboidSetting positions at the cuboid.- Specified by:
setPositionsin interfaceCuboid- Parameters:
position1- - first positionposition2- - second positionselectorType- - flat or cuboid
-
getSelectorType
Description copied from interface:CuboidGet the type of area selection.- Specified by:
getSelectorTypein interfaceCuboid
-
setSelectorType
Description copied from interface:CuboidSet the type of area selection.- Specified by:
setSelectorTypein interfaceCuboid
-
getAABB
public org.spongepowered.api.util.AABB getAABB()Description copied from interface:CuboidGet AABB -
getCenter
public org.spongepowered.math.vector.Vector3d getCenter()Description copied from interface:CuboidGet the center position of the selection. -
getSizeXYZ
public org.spongepowered.math.vector.Vector3d getSizeXYZ()Description copied from interface:CuboidGet the sizes of the area by three coordinates- Specified by:
getSizeXYZin interfaceCuboid
-
getSizeXZ
public int[] getSizeXZ()Description copied from interface:CuboidGet the sizes of the area by two coordinates -
getSize3D
public long getSize3D()Description copied from interface:CuboidObtaining the volume of the area, taking into account all three coordinate axes. -
getSize2D
public long getSize2D()Description copied from interface:CuboidObtaining the volume of the area with only XY coordinates. -
getSize
public long getSize()Description copied from interface:CuboidObtaining the volume of an area depending on its type. -
expand
public void expand(int x, int y, int z) Description copied from interface:CuboidExpanding area -
contract
public void contract(int x, int y, int z) Description copied from interface:CuboidDecreasing area -
containsIntersectsPosition
public boolean containsIntersectsPosition(org.spongepowered.math.vector.Vector3i vector3i) Description copied from interface:CuboidChecking for a position in the area- Specified by:
containsIntersectsPositionin 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:CuboidGetting the minimum position -
getMax
public org.spongepowered.math.vector.Vector3i getMax()Description copied from interface:CuboidGetting the maximum position -
getOppositeCorner
public org.spongepowered.math.vector.Vector3i getOppositeCorner(org.spongepowered.math.vector.Vector3i vector3i) Description copied from interface:CuboidObtaining the opposite corner of area.- Specified by:
getOppositeCornerin 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:CuboidGetting all corner positions of the area- Specified by:
getAllCornersin interfaceCuboid
-
isCorner
public boolean isCorner(org.spongepowered.math.vector.Vector3i vector3i) Description copied from interface:CuboidChecking if the position is a corner position -
toFlat
Description copied from interface:CuboidChanging the positions of the cuboid according to the height of the world. -
contentVersion
public int contentVersion()- Specified by:
contentVersionin interfaceorg.spongepowered.api.data.persistence.DataSerializable
-
toContainer
public org.spongepowered.api.data.persistence.DataContainer toContainer()- Specified by:
toContainerin interfaceorg.spongepowered.api.data.persistence.DataSerializable
-