Record Class BlockBox

java.lang.Object
java.lang.Record
net.minecraft.core.BlockBox
All Implemented Interfaces:
Iterable<BlockPos>

public record BlockBox(BlockPos min, BlockPos max) extends Record implements Iterable<BlockPos>
  • Field Details

    • min

      private final BlockPos min
      The field for the min record component.
    • max

      private final BlockPos max
      The field for the max record component.
    • STREAM_CODEC

      public static final StreamCodec<io.netty.buffer.ByteBuf,BlockBox> STREAM_CODEC
  • Constructor Details

    • BlockBox

      public BlockBox(BlockPos min, BlockPos max)
      Creates an instance of a BlockBox record class.
      Parameters:
      min - the value for the min record component
      max - the value for the max record component
  • Method Details

    • of

      public static BlockBox of(BlockPos p_334061_)
    • of

      public static BlockBox of(BlockPos p_333833_, BlockPos p_333709_)
    • include

      public BlockBox include(BlockPos p_333934_)
    • isBlock

      public boolean isBlock()
    • contains

      public boolean contains(BlockPos p_333773_)
    • aabb

      public AABB aabb()
    • iterator

      public Iterator<BlockPos> iterator()
      Specified by:
      iterator in interface Iterable<BlockPos>
    • sizeX

      public int sizeX()
    • sizeY

      public int sizeY()
    • sizeZ

      public int sizeZ()
    • extend

      public BlockBox extend(Direction p_333798_, int p_333978_)
    • move

      public BlockBox move(Direction p_333771_, int p_333826_)
    • offset

      public BlockBox offset(Vec3i p_333730_)
    • toString

      public final String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • hashCode

      public final int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared with Objects::equals(Object,Object).
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • min

      public BlockPos min()
      Returns the value of the min record component.
      Returns:
      the value of the min record component
    • max

      public BlockPos max()
      Returns the value of the max record component.
      Returns:
      the value of the max record component