Record Class CanyonWorldCarver
java.lang.Object
java.lang.Record
net.minecraft.world.level.levelgen.carver.CanyonWorldCarver
- All Implemented Interfaces:
WorldCarver
public record CanyonWorldCarver(float probability, HeightProvider y, FloatProvider verticalRotation, CanyonWorldCarver.Shape shape)
extends Record
implements WorldCarver
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from interface WorldCarver
WorldCarver.CarveSkipChecker -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final com.mojang.serialization.MapCodec<CanyonWorldCarver> private final floatThe field for theprobabilityrecord component.private final CanyonWorldCarver.ShapeThe field for theshaperecord component.private final FloatProviderThe field for theverticalRotationrecord component.private final HeightProviderThe field for theyrecord component.Fields inherited from interface WorldCarver
CODEC, DIRECT_CODEC, LIST_CODEC -
Constructor Summary
ConstructorsConstructorDescriptionCanyonWorldCarver(float probability, HeightProvider y, FloatProvider verticalRotation, CanyonWorldCarver.Shape shape) Creates an instance of aCanyonWorldCarverrecord class. -
Method Summary
Modifier and TypeMethodDescriptionbooleancarve(WorldGenerationContext context, RandomSource random, ChunkPos chunkPos, ChunkPos sourceChunkPos, CarverOutput output) com.mojang.serialization.MapCodec<CanyonWorldCarver> codec()private voiddoCarve(WorldGenerationContext context, ChunkPos chunkPos, long tunnelSeed, double x, double y, double z, float thickness, float horizontalRotation, float verticalRotation, int step, int distance, double yScale, CarverOutput output) final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.private float[]initWidthFactors(WorldGenerationContext context, RandomSource random) booleanisStartChunk(RandomSource random) floatReturns the value of theprobabilityrecord component.shape()Returns the value of theshaperecord component.private booleanshouldSkip(WorldGenerationContext context, float[] widthFactorPerHeight, double xd, double yd, double zd, int y) final StringtoString()Returns a string representation of this record class.private doubleupdateVerticalRadius(RandomSource random, double verticalRadius, float distance, float currentStep) Returns the value of theverticalRotationrecord component.y()Returns the value of theyrecord component.Methods inherited from interface WorldCarver
getRange
-
Field Details
-
probability
private final float probabilityThe field for theprobabilityrecord component. -
y
The field for theyrecord component. -
verticalRotation
The field for theverticalRotationrecord component. -
shape
The field for theshaperecord component. -
MAP_CODEC
-
-
Constructor Details
-
CanyonWorldCarver
public CanyonWorldCarver(float probability, HeightProvider y, FloatProvider verticalRotation, CanyonWorldCarver.Shape shape) Creates an instance of aCanyonWorldCarverrecord class.- Parameters:
probability- the value for theprobabilityrecord componenty- the value for theyrecord componentverticalRotation- the value for theverticalRotationrecord componentshape- the value for theshaperecord component
-
-
Method Details
-
isStartChunk
- Specified by:
isStartChunkin interfaceWorldCarver
-
carve
public boolean carve(WorldGenerationContext context, RandomSource random, ChunkPos chunkPos, ChunkPos sourceChunkPos, CarverOutput output) - Specified by:
carvein interfaceWorldCarver
-
doCarve
private void doCarve(WorldGenerationContext context, ChunkPos chunkPos, long tunnelSeed, double x, double y, double z, float thickness, float horizontalRotation, float verticalRotation, int step, int distance, double yScale, CarverOutput output) -
initWidthFactors
-
updateVerticalRadius
private double updateVerticalRadius(RandomSource random, double verticalRadius, float distance, float currentStep) -
shouldSkip
private boolean shouldSkip(WorldGenerationContext context, float[] widthFactorPerHeight, double xd, double yd, double zd, int y) -
codec
- Specified by:
codecin interfaceWorldCarver
-
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. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with thecomparemethod from their corresponding wrapper classes. -
probability
public float probability()Returns the value of theprobabilityrecord component.- Returns:
- the value of the
probabilityrecord component
-
y
Returns the value of theyrecord component.- Returns:
- the value of the
yrecord component
-
verticalRotation
Returns the value of theverticalRotationrecord component.- Returns:
- the value of the
verticalRotationrecord component
-
shape
Returns the value of theshaperecord component.- Returns:
- the value of the
shaperecord component
-