Class CanyonWorldCarver
java.lang.Object
net.minecraft.world.level.levelgen.carver.WorldCarver<CanyonCarverConfiguration>
net.minecraft.world.level.levelgen.carver.CanyonWorldCarver
A carver responsible for creating ravines, or canyons.
-
Nested Class Summary
Nested classes/interfaces inherited from class net.minecraft.world.level.levelgen.carver.WorldCarver
WorldCarver.CarveSkipChecker -
Field Summary
Fields inherited from class net.minecraft.world.level.levelgen.carver.WorldCarver
AIR, CANYON, CAVE, CAVE_AIR, LAVA, liquids, NETHER_CAVE, WATER -
Constructor Summary
ConstructorsConstructorDescriptionCanyonWorldCarver(com.mojang.serialization.Codec<CanyonCarverConfiguration> codec) -
Method Summary
Modifier and TypeMethodDescriptionbooleancarve(CarvingContext context, CanyonCarverConfiguration config, ChunkAccess chunk, Function<BlockPos, Holder<Biome>> biomeAccessor, RandomSource random, Aquifer aquifer, ChunkPos chunkPos, CarvingMask carvingMask) Carves the given chunk with caves that originate from the givenchunkPos.private voiddoCarve(CarvingContext context, CanyonCarverConfiguration config, ChunkAccess chunk, Function<BlockPos, Holder<Biome>> biomeAccessor, long seed, Aquifer aquifer, double x, double y, double z, float thickness, float yaw, float pitch, int branchIndex, int branchCount, double horizontalVerticalRatio, CarvingMask carvingMask) private float[]initWidthFactors(CarvingContext context, CanyonCarverConfiguration config, RandomSource random) Generates a random array full of width factors which are used to create the uneven walls of a ravine.booleanisStartChunk(CanyonCarverConfiguration config, RandomSource random) private booleanshouldSkip(CarvingContext context, float[] widthFactors, double relativeX, double relativeY, double relativeZ, int y) private doubleupdateVerticalRadius(CanyonCarverConfiguration config, RandomSource random, double verticalRadius, float branchCount, float currentBranch) Methods inherited from class net.minecraft.world.level.levelgen.carver.WorldCarver
canReach, canReplaceBlock, carveBlock, carveEllipsoid, configured, configuredCodec, getRange
-
Constructor Details
-
CanyonWorldCarver
-
-
Method Details
-
isStartChunk
- Specified by:
isStartChunkin classWorldCarver<CanyonCarverConfiguration>
-
carve
public boolean carve(CarvingContext context, CanyonCarverConfiguration config, ChunkAccess chunk, Function<BlockPos, Holder<Biome>> biomeAccessor, RandomSource random, Aquifer aquifer, ChunkPos chunkPos, CarvingMask carvingMask) Carves the given chunk with caves that originate from the givenchunkPos. This method is invoked 289 times in order to generate each chunk (once for every position in an 8 chunk radius, or 17x17 chunk area, centered around the target chunk).- Specified by:
carvein classWorldCarver<CanyonCarverConfiguration>- Parameters:
chunk- The chunk to be carvedchunkPos- The chunk position this carver is being called from- See Also:
-
doCarve
private void doCarve(CarvingContext context, CanyonCarverConfiguration config, ChunkAccess chunk, Function<BlockPos, Holder<Biome>> biomeAccessor, long seed, Aquifer aquifer, double x, double y, double z, float thickness, float yaw, float pitch, int branchIndex, int branchCount, double horizontalVerticalRatio, CarvingMask carvingMask) -
initWidthFactors
private float[] initWidthFactors(CarvingContext context, CanyonCarverConfiguration config, RandomSource random) Generates a random array full of width factors which are used to create the uneven walls of a ravine.- Returns:
- An array of length
context.getGenDepth(), populated with values between 1.0 and 2.0 inclusive.
-
updateVerticalRadius
private double updateVerticalRadius(CanyonCarverConfiguration config, RandomSource random, double verticalRadius, float branchCount, float currentBranch) -
shouldSkip
private boolean shouldSkip(CarvingContext context, float[] widthFactors, double relativeX, double relativeY, double relativeZ, int y)
-