Record Class IcebergFeature
java.lang.Object
java.lang.Record
net.minecraft.world.level.levelgen.feature.IcebergFeature
- All Implemented Interfaces:
Feature
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final com.mojang.serialization.MapCodec<IcebergFeature> private final BlockStateThe field for thestaterecord component.Fields inherited from interface Feature
DIRECT_CODEC, LIST_CODEC -
Constructor Summary
ConstructorsConstructorDescriptionIcebergFeature(BlockState state) Creates an instance of aIcebergFeaturerecord class. -
Method Summary
Modifier and TypeMethodDescriptionprivate booleanbelowIsAir(BlockGetter level, BlockPos pos) private voidcarve(int radius, int yOff, BlockPos globalOrigin, LevelAccessor level, boolean underWater, double angle, BlockPos localOrigin, int shapeEllipseA, int shapeEllipseC) com.mojang.serialization.MapCodec<IcebergFeature> codec()final booleanIndicates whether some other object is "equal to" this one.private voidgenerateCutOut(RandomSource random, LevelAccessor level, int width, int height, BlockPos globalOrigin, boolean isEllipse, int shapeEllipseA, double shapeAngle, int shapeEllipseC) private voidgenerateIcebergBlock(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) private intgetEllipseC(int yOff, int height, int shapeEllipseC) final inthashCode()Returns a hash code value for this object.private intheightDependentRadiusEllipse(int yOff, int height, int width) private intheightDependentRadiusRound(RandomSource random, int yOff, int height, int width) private intheightDependentRadiusSteep(RandomSource random, int yOff, int height, int width) private static booleanisIcebergState(BlockState state) booleanplace(WorldGenLevel level, ChunkGenerator chunkGenerator, RandomSource random, BlockPos origin) private voidremoveFloatingSnowLayer(LevelAccessor level, BlockPos pos) private voidsetIcebergBlock(BlockPos pos, LevelAccessor level, RandomSource random, int hDiff, int height, boolean isEllipse, boolean snowOnTop, BlockState mainBlockState) private doublesignedDistanceCircle(int xo, int zo, BlockPos origin, int radius, RandomSource random) private doublesignedDistanceEllipse(int xo, int zo, BlockPos origin, int a, int c, double angle) private voidsmooth(LevelAccessor level, BlockPos origin, int width, int height, boolean isEllipse, int shapeEllipseA) state()Returns the value of thestaterecord component.final StringtoString()Returns a string representation of this record class.Methods inherited from interface Feature
getSubFeatures, markAboveForPostProcessing, safeSetBlock, setBlock
-
Field Details
-
state
The field for thestaterecord component. -
CODEC
-
-
Constructor Details
-
IcebergFeature
Creates an instance of aIcebergFeaturerecord class.- Parameters:
state- the value for thestaterecord component
-
-
Method Details
-
codec
-
place
public boolean place(WorldGenLevel level, ChunkGenerator chunkGenerator, RandomSource random, BlockPos origin) -
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
-
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
-
heightDependentRadiusRound
-
heightDependentRadiusEllipse
private int heightDependentRadiusEllipse(int yOff, int height, int width) -
heightDependentRadiusSteep
-
isIcebergState
-
belowIsAir
-
smooth
private void smooth(LevelAccessor level, BlockPos origin, int width, int height, boolean isEllipse, int shapeEllipseA) -
toString
-
hashCode
-
equals
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 withObjects::equals(Object,Object). -
state
Returns the value of thestaterecord component.- Returns:
- the value of the
staterecord component
-