Record Class DeltaFeature

java.lang.Object
java.lang.Record
net.minecraft.world.level.levelgen.feature.DeltaFeature
All Implemented Interfaces:
Feature

public record DeltaFeature(BlockState contents, BlockState rim, IntProvider size, IntProvider rimSize) extends Record implements Feature
  • Field Details

    • contents

      private final BlockState contents
      The field for the contents record component.
    • rim

      private final BlockState rim
      The field for the rim record component.
    • size

      private final IntProvider size
      The field for the size record component.
    • rimSize

      private final IntProvider rimSize
      The field for the rimSize record component.
    • CODEC

      public static final com.mojang.serialization.MapCodec<DeltaFeature> CODEC
    • CANNOT_REPLACE

      private static final ImmutableList<Block> CANNOT_REPLACE
    • DIRECTIONS

      private static final Direction[] DIRECTIONS
    • RIM_SPAWN_CHANCE

      private static final double RIM_SPAWN_CHANCE
      See Also:
  • Constructor Details

    • DeltaFeature

      public DeltaFeature(BlockState contents, BlockState rim, IntProvider size, IntProvider rimSize)
      Creates an instance of a DeltaFeature record class.
      Parameters:
      contents - the value for the contents record component
      rim - the value for the rim record component
      size - the value for the size record component
      rimSize - the value for the rimSize record component
  • Method Details

    • codec

      public com.mojang.serialization.MapCodec<DeltaFeature> codec()
      Specified by:
      codec in interface Feature
    • place

      public boolean place(WorldGenLevel level, ChunkGenerator chunkGenerator, RandomSource random, BlockPos origin)
      Specified by:
      place in interface Feature
    • isClear

      private boolean isClear(LevelAccessor level, BlockPos pos)
    • 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.
    • contents

      public BlockState contents()
      Returns the value of the contents record component.
      Returns:
      the value of the contents record component
    • rim

      public BlockState rim()
      Returns the value of the rim record component.
      Returns:
      the value of the rim record component
    • size

      public IntProvider size()
      Returns the value of the size record component.
      Returns:
      the value of the size record component
    • rimSize

      public IntProvider rimSize()
      Returns the value of the rimSize record component.
      Returns:
      the value of the rimSize record component