Record Class DensityVolume

java.lang.Object
java.lang.Record
net.minecraft.world.level.levelgen.densityfunction.DensityVolume

public record DensityVolume(int sizeX, int sizeY, int sizeZ, int minBlockX, int minBlockY, int minBlockZ, int stepBlockX, int stepBlockY, int stepBlockZ) extends Record
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    private final int
    The field for the minBlockX record component.
    private final int
    The field for the minBlockY record component.
    private final int
    The field for the minBlockZ record component.
    static final int
     
    private final int
    The field for the sizeX record component.
    private final int
    The field for the sizeY record component.
    private final int
    The field for the sizeZ record component.
    private final int
    The field for the stepBlockX record component.
    private final int
    The field for the stepBlockY record component.
    private final int
    The field for the stepBlockZ record component.
  • Constructor Summary

    Constructors
    Constructor
    Description
    DensityVolume(int sizeX, int sizeY, int sizeZ, int minBlockX, int minBlockY, int minBlockZ)
     
    DensityVolume(int sizeX, int sizeY, int sizeZ, int minBlockX, int minBlockY, int minBlockZ, int stepBlockX, int stepBlockY, int stepBlockZ)
    Creates an instance of a DensityVolume record class.
  • Method Summary

    Modifier and Type
    Method
    Description
    int
    blockX(int x)
     
    int
    blockY(int y)
     
    int
    blockZ(int z)
     
    private boolean
    containsBlockRelative(int relativeX, int relativeY, int relativeZ)
     
    final boolean
    Indicates whether some other object is "equal to" this one.
    final int
    Returns a hash code value for this object.
    int
    indexOfBlock(int blockX, int blockY, int blockZ)
     
    int
    indexUnchecked(int indexX, int indexY, int indexZ)
     
    boolean
     
    int
     
    int
     
    int
     
    int
    Returns the value of the minBlockX record component.
    int
    Returns the value of the minBlockY record component.
    int
    Returns the value of the minBlockZ record component.
    int
     
    int
    Returns the value of the sizeX record component.
    int
    Returns the value of the sizeY record component.
    int
    Returns the value of the sizeZ record component.
    int
    Returns the value of the stepBlockX record component.
    int
    Returns the value of the stepBlockY record component.
    int
    Returns the value of the stepBlockZ record component.
    final String
    Returns a string representation of this record class.

    Methods inherited from class Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
  • Field Details

    • sizeX

      private final int sizeX
      The field for the sizeX record component.
    • sizeY

      private final int sizeY
      The field for the sizeY record component.
    • sizeZ

      private final int sizeZ
      The field for the sizeZ record component.
    • minBlockX

      private final int minBlockX
      The field for the minBlockX record component.
    • minBlockY

      private final int minBlockY
      The field for the minBlockY record component.
    • minBlockZ

      private final int minBlockZ
      The field for the minBlockZ record component.
    • stepBlockX

      private final int stepBlockX
      The field for the stepBlockX record component.
    • stepBlockY

      private final int stepBlockY
      The field for the stepBlockY record component.
    • stepBlockZ

      private final int stepBlockZ
      The field for the stepBlockZ record component.
    • NO_BLOCK

      public static final int NO_BLOCK
      See Also:
  • Constructor Details

    • DensityVolume

      public DensityVolume(int sizeX, int sizeY, int sizeZ, int minBlockX, int minBlockY, int minBlockZ, int stepBlockX, int stepBlockY, int stepBlockZ)
      Creates an instance of a DensityVolume record class.
      Parameters:
      sizeX - the value for the sizeX record component
      sizeY - the value for the sizeY record component
      sizeZ - the value for the sizeZ record component
      minBlockX - the value for the minBlockX record component
      minBlockY - the value for the minBlockY record component
      minBlockZ - the value for the minBlockZ record component
      stepBlockX - the value for the stepBlockX record component
      stepBlockY - the value for the stepBlockY record component
      stepBlockZ - the value for the stepBlockZ record component
    • DensityVolume

      public DensityVolume(int sizeX, int sizeY, int sizeZ, int minBlockX, int minBlockY, int minBlockZ)
  • Method Details

    • indexUnchecked

      public int indexUnchecked(int indexX, int indexY, int indexZ)
    • blockX

      public int blockX(int x)
    • blockY

      public int blockY(int y)
    • blockZ

      public int blockZ(int z)
    • maxBlockX

      public int maxBlockX()
    • maxBlockY

      public int maxBlockY()
    • maxBlockZ

      public int maxBlockZ()
    • size

      public int size()
    • intersects

      public boolean intersects(BoundingBox box)
    • containsBlockRelative

      private boolean containsBlockRelative(int relativeX, int relativeY, int relativeZ)
    • indexOfBlock

      public int indexOfBlock(int blockX, int blockY, int blockZ)
    • 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 the compare method from their corresponding wrapper classes.
      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.
    • sizeX

      public int sizeX()
      Returns the value of the sizeX record component.
      Returns:
      the value of the sizeX record component
    • sizeY

      public int sizeY()
      Returns the value of the sizeY record component.
      Returns:
      the value of the sizeY record component
    • sizeZ

      public int sizeZ()
      Returns the value of the sizeZ record component.
      Returns:
      the value of the sizeZ record component
    • minBlockX

      public int minBlockX()
      Returns the value of the minBlockX record component.
      Returns:
      the value of the minBlockX record component
    • minBlockY

      public int minBlockY()
      Returns the value of the minBlockY record component.
      Returns:
      the value of the minBlockY record component
    • minBlockZ

      public int minBlockZ()
      Returns the value of the minBlockZ record component.
      Returns:
      the value of the minBlockZ record component
    • stepBlockX

      public int stepBlockX()
      Returns the value of the stepBlockX record component.
      Returns:
      the value of the stepBlockX record component
    • stepBlockY

      public int stepBlockY()
      Returns the value of the stepBlockY record component.
      Returns:
      the value of the stepBlockY record component
    • stepBlockZ

      public int stepBlockZ()
      Returns the value of the stepBlockZ record component.
      Returns:
      the value of the stepBlockZ record component