Record Class IcebergFeature

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

public record IcebergFeature(BlockState state) extends Record implements Feature
  • Field Details

    • state

      private final BlockState state
      The field for the state record component.
    • CODEC

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

    • IcebergFeature

      public IcebergFeature(BlockState state)
      Creates an instance of a IcebergFeature record class.
      Parameters:
      state - the value for the state record component
  • Method Details

    • codec

      public com.mojang.serialization.MapCodec<IcebergFeature> 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
    • generateCutOut

      private void generateCutOut(RandomSource random, LevelAccessor level, int width, int height, BlockPos globalOrigin, boolean isEllipse, int shapeEllipseA, double shapeAngle, int shapeEllipseC)
    • carve

      private void carve(int radius, int yOff, BlockPos globalOrigin, LevelAccessor level, boolean underWater, double angle, BlockPos localOrigin, int shapeEllipseA, int shapeEllipseC)
    • removeFloatingSnowLayer

      private void removeFloatingSnowLayer(LevelAccessor level, BlockPos pos)
    • generateIcebergBlock

      private void generateIcebergBlock(LevelAccessor level, RandomSource random, BlockPos origin, int height, int xo, int yOff, int zo, int radius, int a, boolean isEllipse, int shapeEllipseC, double shapeAngle, boolean snowOnTop, BlockState mainBlockState)
    • setIcebergBlock

      private void setIcebergBlock(BlockPos pos, LevelAccessor level, RandomSource random, int hDiff, int height, boolean isEllipse, boolean snowOnTop, BlockState mainBlockState)
    • getEllipseC

      private int getEllipseC(int yOff, int height, int shapeEllipseC)
    • signedDistanceCircle

      private double signedDistanceCircle(int xo, int zo, BlockPos origin, int radius, RandomSource random)
    • signedDistanceEllipse

      private double signedDistanceEllipse(int xo, int zo, BlockPos origin, int a, int c, double angle)
    • heightDependentRadiusRound

      private int heightDependentRadiusRound(RandomSource random, int yOff, int height, int width)
    • heightDependentRadiusEllipse

      private int heightDependentRadiusEllipse(int yOff, int height, int width)
    • heightDependentRadiusSteep

      private int heightDependentRadiusSteep(RandomSource random, int yOff, int height, int width)
    • isIcebergState

      private static boolean isIcebergState(BlockState state)
    • belowIsAir

      private boolean belowIsAir(BlockGetter level, BlockPos pos)
    • smooth

      private void smooth(LevelAccessor level, BlockPos origin, int width, int height, boolean isEllipse, int shapeEllipseA)
    • 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.
    • state

      public BlockState state()
      Returns the value of the state record component.
      Returns:
      the value of the state record component