Record Class CaveWorldCarver
java.lang.Object
java.lang.Record
net.minecraft.world.level.levelgen.carver.CaveWorldCarver
- All Implemented Interfaces:
WorldCarver
public record CaveWorldCarver(float probability, HeightProvider y, IntProvider count, FloatProvider thickness, boolean weirdThicknessBias, FloatProvider roomVerticalRadiusMultiplier, FloatProvider horizontalRadiusMultiplier, FloatProvider verticalRadiusMultiplier, FloatProvider startVerticalRadiusMultiplier, FloatProvider floorLevel)
extends Record
implements WorldCarver
-
Nested Class Summary
Nested classes/interfaces inherited from interface WorldCarver
WorldCarver.CarveSkipChecker -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final IntProviderThe field for thecountrecord component.private final FloatProviderThe field for thefloorLevelrecord component.private final FloatProviderThe field for thehorizontalRadiusMultiplierrecord component.static final com.mojang.serialization.MapCodec<CaveWorldCarver> private final floatThe field for theprobabilityrecord component.private final FloatProviderThe field for theroomVerticalRadiusMultiplierrecord component.private final FloatProviderThe field for thestartVerticalRadiusMultiplierrecord component.private final FloatProviderThe field for thethicknessrecord component.private final FloatProviderThe field for theverticalRadiusMultiplierrecord component.private final booleanThe field for theweirdThicknessBiasrecord component.private final HeightProviderThe field for theyrecord component.Fields inherited from interface WorldCarver
CODEC, DIRECT_CODEC, LIST_CODEC -
Constructor Summary
ConstructorsConstructorDescriptionCaveWorldCarver(float probability, HeightProvider y, IntProvider count, FloatProvider thickness, boolean weirdThicknessBias, FloatProvider roomVerticalRadiusMultiplier, FloatProvider horizontalRadiusMultiplier, FloatProvider verticalRadiusMultiplier, FloatProvider startVerticalRadiusMultiplier, FloatProvider floorLevel) Creates an instance of aCaveWorldCarverrecord class. -
Method Summary
Modifier and TypeMethodDescriptionbooleancarve(WorldGenerationContext context, RandomSource random, ChunkPos chunkPos, ChunkPos sourceChunkPos, CarverOutput output) com.mojang.serialization.MapCodec<CaveWorldCarver> codec()count()Returns the value of thecountrecord component.private voidcreateRoom(ChunkPos chunkPos, double x, double y, double z, float thickness, double yScale, CarverOutput output, WorldCarver.CarveSkipChecker skipChecker) private voidcreateTunnel(ChunkPos chunkPos, long tunnelSeed, double x, double y, double z, double horizontalRadiusMultiplier, double verticalRadiusMultiplier, float thickness, float horizontalRotation, float verticalRotation, int step, int dist, double yScale, CarverOutput output, WorldCarver.CarveSkipChecker skipChecker) final booleanIndicates whether some other object is "equal to" this one.Returns the value of thefloorLevelrecord component.private floatgetThickness(RandomSource random) final inthashCode()Returns a hash code value for this object.Returns the value of thehorizontalRadiusMultiplierrecord component.booleanisStartChunk(RandomSource random) floatReturns the value of theprobabilityrecord component.Returns the value of theroomVerticalRadiusMultiplierrecord component.private static booleanshouldSkip(double xd, double yd, double zd, double floorLevel) Returns the value of thestartVerticalRadiusMultiplierrecord component.Returns the value of thethicknessrecord component.final StringtoString()Returns a string representation of this record class.Returns the value of theverticalRadiusMultiplierrecord component.booleanReturns the value of theweirdThicknessBiasrecord 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. -
count
The field for thecountrecord component. -
thickness
The field for thethicknessrecord component. -
weirdThicknessBias
private final boolean weirdThicknessBiasThe field for theweirdThicknessBiasrecord component. -
roomVerticalRadiusMultiplier
The field for theroomVerticalRadiusMultiplierrecord component. -
horizontalRadiusMultiplier
The field for thehorizontalRadiusMultiplierrecord component. -
verticalRadiusMultiplier
The field for theverticalRadiusMultiplierrecord component. -
startVerticalRadiusMultiplier
The field for thestartVerticalRadiusMultiplierrecord component. -
floorLevel
The field for thefloorLevelrecord component. -
MAP_CODEC
-
-
Constructor Details
-
CaveWorldCarver
public CaveWorldCarver(float probability, HeightProvider y, IntProvider count, FloatProvider thickness, boolean weirdThicknessBias, FloatProvider roomVerticalRadiusMultiplier, FloatProvider horizontalRadiusMultiplier, FloatProvider verticalRadiusMultiplier, FloatProvider startVerticalRadiusMultiplier, FloatProvider floorLevel) Creates an instance of aCaveWorldCarverrecord class.- Parameters:
probability- the value for theprobabilityrecord componenty- the value for theyrecord componentcount- the value for thecountrecord componentthickness- the value for thethicknessrecord componentweirdThicknessBias- the value for theweirdThicknessBiasrecord componentroomVerticalRadiusMultiplier- the value for theroomVerticalRadiusMultiplierrecord componenthorizontalRadiusMultiplier- the value for thehorizontalRadiusMultiplierrecord componentverticalRadiusMultiplier- the value for theverticalRadiusMultiplierrecord componentstartVerticalRadiusMultiplier- the value for thestartVerticalRadiusMultiplierrecord componentfloorLevel- the value for thefloorLevelrecord 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
-
getThickness
-
createRoom
private void createRoom(ChunkPos chunkPos, double x, double y, double z, float thickness, double yScale, CarverOutput output, WorldCarver.CarveSkipChecker skipChecker) -
createTunnel
private void createTunnel(ChunkPos chunkPos, long tunnelSeed, double x, double y, double z, double horizontalRadiusMultiplier, double verticalRadiusMultiplier, float thickness, float horizontalRotation, float verticalRotation, int step, int dist, double yScale, CarverOutput output, WorldCarver.CarveSkipChecker skipChecker) -
shouldSkip
private static boolean shouldSkip(double xd, double yd, double zd, double floorLevel) -
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
-
count
Returns the value of thecountrecord component.- Returns:
- the value of the
countrecord component
-
thickness
Returns the value of thethicknessrecord component.- Returns:
- the value of the
thicknessrecord component
-
weirdThicknessBias
public boolean weirdThicknessBias()Returns the value of theweirdThicknessBiasrecord component.- Returns:
- the value of the
weirdThicknessBiasrecord component
-
roomVerticalRadiusMultiplier
Returns the value of theroomVerticalRadiusMultiplierrecord component.- Returns:
- the value of the
roomVerticalRadiusMultiplierrecord component
-
horizontalRadiusMultiplier
Returns the value of thehorizontalRadiusMultiplierrecord component.- Returns:
- the value of the
horizontalRadiusMultiplierrecord component
-
verticalRadiusMultiplier
Returns the value of theverticalRadiusMultiplierrecord component.- Returns:
- the value of the
verticalRadiusMultiplierrecord component
-
startVerticalRadiusMultiplier
Returns the value of thestartVerticalRadiusMultiplierrecord component.- Returns:
- the value of the
startVerticalRadiusMultiplierrecord component
-
floorLevel
Returns the value of thefloorLevelrecord component.- Returns:
- the value of the
floorLevelrecord component
-