Record Class FoliagePlacer.FoliageAttachment

java.lang.Object
java.lang.Record
net.minecraft.world.level.levelgen.feature.foliageplacers.FoliagePlacer.FoliageAttachment
Enclosing class:
FoliagePlacer

public static record FoliagePlacer.FoliageAttachment(BlockPos pos, int radiusOffsetXZ, int foliageHeightOffset, int sizeX, int sizeZ) extends Record
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    private final int
    The field for the foliageHeightOffset record component.
    private final BlockPos
    The field for the pos record component.
    private final int
    The field for the radiusOffsetXZ record component.
    private final int
    The field for the sizeX record component.
    private final int
    The field for the sizeZ record component.
  • Constructor Summary

    Constructors
    Constructor
    Description
    FoliageAttachment(BlockPos pos, int radiusOffsetXZ, boolean doubleTrunk)
     
    FoliageAttachment(BlockPos pos, int radiusOffsetXZ, int sizeX, int sizeZ)
     
    FoliageAttachment(BlockPos pos, int radiusOffsetXZ, int foliageHeightOffset, int sizeX, int sizeZ)
    Creates an instance of a FoliageAttachment record class.
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
     
    final boolean
    Indicates whether some other object is "equal to" this one.
    int
    Returns the value of the foliageHeightOffset record component.
    final int
    Returns a hash code value for this object.
    pos()
    Returns the value of the pos record component.
    int
    Returns the value of the radiusOffsetXZ record component.
    int
    Returns the value of the sizeX record component.
    int
    Returns the value of the sizeZ 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

    • pos

      private final BlockPos pos
      The field for the pos record component.
    • radiusOffsetXZ

      private final int radiusOffsetXZ
      The field for the radiusOffsetXZ record component.
    • foliageHeightOffset

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

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

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

    • FoliageAttachment

      public FoliageAttachment(BlockPos pos, int radiusOffsetXZ, boolean doubleTrunk)
    • FoliageAttachment

      public FoliageAttachment(BlockPos pos, int radiusOffsetXZ, int sizeX, int sizeZ)
    • FoliageAttachment

      public FoliageAttachment(BlockPos pos, int radiusOffsetXZ, int foliageHeightOffset, int sizeX, int sizeZ)
      Creates an instance of a FoliageAttachment record class.
      Parameters:
      pos - the value for the pos record component
      radiusOffsetXZ - the value for the radiusOffsetXZ record component
      foliageHeightOffset - the value for the foliageHeightOffset record component
      sizeX - the value for the sizeX record component
      sizeZ - the value for the sizeZ record component
  • Method Details

    • doubleTrunk

      public boolean doubleTrunk()
    • 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. Reference components are compared with Objects::equals(Object,Object); primitive components 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.
    • pos

      public BlockPos pos()
      Returns the value of the pos record component.
      Returns:
      the value of the pos record component
    • radiusOffsetXZ

      public int radiusOffsetXZ()
      Returns the value of the radiusOffsetXZ record component.
      Returns:
      the value of the radiusOffsetXZ record component
    • foliageHeightOffset

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

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

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