Class CuboidArea

java.lang.Object
de.z0rdak.yawp.core.area.MarkedArea
de.z0rdak.yawp.core.area.CuboidArea
All Implemented Interfaces:
IMarkableArea

public class CuboidArea extends MarkedArea
Represents and wraps a simple AxisAlignedBB. This area is marked by two positions and thus spans a cuboid shape
  • Field Details

    • CODEC

      public static com.mojang.serialization.Codec<CuboidArea> CODEC
  • Constructor Details

    • CuboidArea

      public CuboidArea(net.minecraft.world.level.levelgen.structure.BoundingBox area)
    • CuboidArea

      public CuboidArea(net.minecraft.core.BlockPos p1, net.minecraft.core.BlockPos p2)
  • Method Details

    • getType

      public MarkedAreaType<?> getType()
    • expand

      public static CuboidArea expand(CuboidArea area, int min, int max)
    • contains

      public boolean contains(net.minecraft.core.BlockPos pos)
    • contains

      public boolean contains(CuboidArea inner)
    • contains

      public boolean contains(SphereArea inner)
    • getVertices

      public List<net.minecraft.core.BlockPos> getVertices()
      Returns the vertices of the cuboid area as a list of BlockPos. Z+ p7-----p8 /| /| Y+ p5------p6| | | | | | p3----|-p4 |/ |/ p1------p2 X+
      Returns:
      [p1, p2, p3, p4, p5, p6, p7, p8] as list of BlockPos
    • getHull

      public Set<net.minecraft.core.BlockPos> getHull()
      Returns the hull of the cuboid area as a set of BlockPos. The hull is the outermost layer of blocks of the cuboid area. The hull is calculated by iterating through the faces of the cuboid area and collecting the blocks in each face.
      Returns:
      hull as set of BlockPos of cuboid area
    • intersects

      public boolean intersects(SphereArea other)
    • getArea

      public net.minecraft.world.level.levelgen.structure.BoundingBox getArea()
    • getXsize

      public int getXsize()
    • getZsize

      public int getZsize()
    • getYsize

      public int getYsize()
    • getAreaP1

      public net.minecraft.core.BlockPos getAreaP1()
    • getAreaP2

      public net.minecraft.core.BlockPos getAreaP2()
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • markedBlocks

      public Set<net.minecraft.core.BlockPos> markedBlocks()
    • getFrame

      public Set<net.minecraft.core.BlockPos> getFrame()
      Returns the outer frame of the cuboid area as a set of BlockPos.
      Returns:
      outer frame as set of BlockPos of cuboid area
    • getMinimalOutline

      public Set<net.minecraft.core.BlockPos> getMinimalOutline()
    • containsOther

      public boolean containsOther(IMarkableArea inner)
    • intersects

      public boolean intersects(IMarkableArea other)