Record Class CuboidPlacement

java.lang.Object
java.lang.Record
net.minecraft.world.level.levelgen.feature.CuboidPlacement
All Implemented Interfaces:
PlacementModifier

public record CuboidPlacement(IntProvider xzSize, IntProvider ySize, boolean includeEdges, boolean includeInterior) extends Record implements PlacementModifier
  • Field Details

    • xzSize

      private final IntProvider xzSize
      The field for the xzSize record component.
    • ySize

      private final IntProvider ySize
      The field for the ySize record component.
    • includeEdges

      private final boolean includeEdges
      The field for the includeEdges record component.
    • includeInterior

      private final boolean includeInterior
      The field for the includeInterior record component.
    • CODEC

      public static final com.mojang.serialization.MapCodec<CuboidPlacement> CODEC
  • Constructor Details

    • CuboidPlacement

      public CuboidPlacement(IntProvider xzSize, IntProvider ySize, boolean includeEdges, boolean includeInterior)
      Creates an instance of a CuboidPlacement record class.
      Parameters:
      xzSize - the value for the xzSize record component
      ySize - the value for the ySize record component
      includeEdges - the value for the includeEdges record component
      includeInterior - the value for the includeInterior record component
  • Method Details

    • codec

      public com.mojang.serialization.MapCodec<CuboidPlacement> codec()
      Specified by:
      codec in interface PlacementModifier
    • modify

      public void modify(PlacementContext context, RandomSource random, BlockPos origin, Consumer<BlockPos> output)
      Specified by:
      modify in interface PlacementModifier
    • 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.
    • xzSize

      public IntProvider xzSize()
      Returns the value of the xzSize record component.
      Returns:
      the value of the xzSize record component
    • ySize

      public IntProvider ySize()
      Returns the value of the ySize record component.
      Returns:
      the value of the ySize record component
    • includeEdges

      public boolean includeEdges()
      Returns the value of the includeEdges record component.
      Returns:
      the value of the includeEdges record component
    • includeInterior

      public boolean includeInterior()
      Returns the value of the includeInterior record component.
      Returns:
      the value of the includeInterior record component