Class CuboidImpl

java.lang.Object
sawfowl.regionguard.implementsapi.data.CuboidImpl
All Implemented Interfaces:
org.spongepowered.api.data.persistence.DataSerializable, Cuboid

@ConfigSerializable public class CuboidImpl extends Object implements Cuboid
  • Nested Class Summary

    Nested classes/interfaces inherited from interface sawfowl.regionguard.api.data.Cuboid

    Cuboid.Builder
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
     
    boolean
    containsIntersectsPosition(org.spongepowered.math.vector.Vector3i vector3i)
    Checking for a position in the area
    int
     
    void
    contract(int x, int y, int z)
    Decreasing area
    void
    expand(int x, int y, int z)
    Expanding area
    org.spongepowered.api.util.AABB
    Get AABB
    List<org.spongepowered.math.vector.Vector3i>
    Getting all corner positions of the area
    List<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
    Getting the maximum position
    org.spongepowered.math.vector.Vector3i
    Getting the minimum position
    org.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
    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 coordinates
    int[]
    Get the sizes of the area by two coordinates
    boolean
    isCorner(org.spongepowered.math.vector.Vector3i vector3i)
    Checking if the position is a corner position
    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
    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.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • CuboidImpl

      public CuboidImpl()
  • Method Details

    • builder

      public Cuboid.Builder builder()
    • getAllPositions

      public List<org.spongepowered.math.vector.Vector3i> getAllPositions()
      Description copied from interface: Cuboid
      Getting all positions in the cuboid.
      Specified by:
      getAllPositions in interface Cuboid
    • getPositionsXZ

      public List<org.spongepowered.math.vector.Vector2i> getPositionsXZ()
      Description copied from interface: Cuboid
      Getting all positions in the cuboid. Excludes the Y-axis.
      Specified by:
      getPositionsXZ in interface Cuboid
    • 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 interface Cuboid
      Parameters:
      position1 - - first position
      position2 - - second position
      selectorType - - flat or cuboid
    • getSelectorType

      public SelectorTypes getSelectorType()
      Description copied from interface: Cuboid
      Get the type of area selection.
      Specified by:
      getSelectorType in interface Cuboid
    • setSelectorType

      public void setSelectorType(SelectorTypes selectorType)
      Description copied from interface: Cuboid
      Set the type of area selection.
      Specified by:
      setSelectorType in interface Cuboid
    • getAABB

      public org.spongepowered.api.util.AABB getAABB()
      Description copied from interface: Cuboid
      Get AABB
      Specified by:
      getAABB in interface Cuboid
    • getCenter

      public org.spongepowered.math.vector.Vector3d getCenter()
      Description copied from interface: Cuboid
      Get the center position of the selection.
      Specified by:
      getCenter in interface Cuboid
    • 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 interface Cuboid
    • getSizeXZ

      public int[] getSizeXZ()
      Description copied from interface: Cuboid
      Get the sizes of the area by two coordinates
      Specified by:
      getSizeXZ in interface Cuboid
    • getSize3D

      public long getSize3D()
      Description copied from interface: Cuboid
      Obtaining the volume of the area, taking into account all three coordinate axes.
      Specified by:
      getSize3D in interface Cuboid
    • getSize2D

      public long getSize2D()
      Description copied from interface: Cuboid
      Obtaining the volume of the area with only XY coordinates.
      Specified by:
      getSize2D in interface Cuboid
    • getSize

      public long getSize()
      Description copied from interface: Cuboid
      Obtaining the volume of an area depending on its type.
      Specified by:
      getSize in interface Cuboid
    • expand

      public void expand(int x, int y, int z)
      Description copied from interface: Cuboid
      Expanding area
      Specified by:
      expand in interface Cuboid
    • contract

      public void contract(int x, int y, int z)
      Description copied from interface: Cuboid
      Decreasing area
      Specified by:
      contract in interface Cuboid
    • 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 interface Cuboid
      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
      Specified by:
      getMin in interface Cuboid
    • getMax

      public org.spongepowered.math.vector.Vector3i getMax()
      Description copied from interface: Cuboid
      Getting the maximum position
      Specified by:
      getMax in interface Cuboid
    • 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 interface Cuboid
      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

      public List<org.spongepowered.math.vector.Vector3i> getAllCorners()
      Description copied from interface: Cuboid
      Getting all corner positions of the area
      Specified by:
      getAllCorners in interface Cuboid
    • isCorner

      public boolean isCorner(org.spongepowered.math.vector.Vector3i vector3i)
      Description copied from interface: Cuboid
      Checking if the position is a corner position
      Specified by:
      isCorner in interface Cuboid
      Parameters:
      vector3i - - checked position
      Returns:
      - true if position is corner
      - false if position isn't corner
    • toFlat

      public Cuboid toFlat(org.spongepowered.api.world.server.ServerWorld world)
      Description copied from interface: Cuboid
      Changing the positions of the cuboid according to the height of the world.
      Specified by:
      toFlat in interface Cuboid
    • contentVersion

      public int contentVersion()
      Specified by:
      contentVersion in interface org.spongepowered.api.data.persistence.DataSerializable
    • toContainer

      public org.spongepowered.api.data.persistence.DataContainer toContainer()
      Specified by:
      toContainer in interface org.spongepowered.api.data.persistence.DataSerializable