Package de.z0rdak.yawp.core.area
Class CuboidArea
java.lang.Object
de.z0rdak.yawp.core.area.AbstractArea
de.z0rdak.yawp.core.area.CuboidArea
- All Implemented Interfaces:
IMarkableArea,INbtSerializable<net.minecraft.nbt.CompoundTag>
Represents and wraps a simple AxisAlignedBB.
This area is marked by two positions and thus spans a cuboid shape
-
Constructor Summary
ConstructorsConstructorDescriptionCuboidArea(net.minecraft.core.BlockPos p1, net.minecraft.core.BlockPos p2) CuboidArea(net.minecraft.nbt.CompoundTag nbt) CuboidArea(net.minecraft.world.level.levelgen.structure.BoundingBox area) -
Method Summary
Modifier and TypeMethodDescriptionbooleancontains(CuboidArea inner) booleancontains(SphereArea inner) booleancontains(net.minecraft.core.BlockPos pos) booleancontainsOther(IMarkableArea inner) voiddeserializeNBT(net.minecraft.nbt.CompoundTag nbt) static CuboidAreaexpand(CuboidArea area, int min, int max) net.minecraft.world.level.levelgen.structure.BoundingBoxgetArea()net.minecraft.core.BlockPosnet.minecraft.core.BlockPosSet<net.minecraft.core.BlockPos> getFrame()Returns the outer frame of the cuboid area as a set of BlockPos.Set<net.minecraft.core.BlockPos> getHull()Returns the hull of the cuboid area as a set of BlockPos.List<net.minecraft.core.BlockPos> Returns the vertices of the cuboid area as a list of BlockPos.intgetXsize()intgetYsize()intgetZsize()booleanintersects(IMarkableArea other) booleanintersects(SphereArea other) List<net.minecraft.core.BlockPos> net.minecraft.nbt.CompoundTagtoString()Methods inherited from class de.z0rdak.yawp.core.area.AbstractArea
getAreaType
-
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) -
CuboidArea
public CuboidArea(net.minecraft.nbt.CompoundTag nbt)
-
-
Method Details
-
expand
-
contains
public boolean contains(net.minecraft.core.BlockPos pos) -
contains
-
contains
-
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
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
-
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() -
serializeNBT
public net.minecraft.nbt.CompoundTag serializeNBT()- Specified by:
serializeNBTin interfaceINbtSerializable<net.minecraft.nbt.CompoundTag>- Overrides:
serializeNBTin classAbstractArea
-
deserializeNBT
public void deserializeNBT(net.minecraft.nbt.CompoundTag nbt) - Specified by:
deserializeNBTin interfaceINbtSerializable<net.minecraft.nbt.CompoundTag>- Overrides:
deserializeNBTin classAbstractArea
-
toString
-
markedBlocks
-
getFrame
Returns the outer frame of the cuboid area as a set of BlockPos.- Returns:
- outer frame as set of BlockPos of cuboid area
-
containsOther
-
intersects
-