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> p_64711_) -
Method Summary
Modifier and TypeMethodDescriptionbooleancarve(CarvingContext p_224813_, CanyonCarverConfiguration p_224814_, ChunkAccess p_224815_, Function<BlockPos, Holder<Biome>> p_224816_, RandomSource p_224817_, Aquifer p_224818_, ChunkPos p_224819_, CarvingMask p_224820_) Carves the given chunk with caves that originate from the givenchunkPos.private voiddoCarve(CarvingContext pContext, CanyonCarverConfiguration pConfig, ChunkAccess pChunk, Function<BlockPos, Holder<Biome>> pBiomeAccessor, long pSeed, Aquifer pAquifer, double pX, double pY, double pZ, float pThickness, float pYaw, float pPitch, int pBranchIndex, int pBranchCount, double pHorizontalVerticalRatio, CarvingMask pCarvingMask) private float[]initWidthFactors(CarvingContext pContext, CanyonCarverConfiguration pConfig, RandomSource pRandom) Generates a random array full of width factors which are used to create the uneven walls of a ravine.booleanisStartChunk(CanyonCarverConfiguration p_224797_, RandomSource p_224798_) private booleanshouldSkip(CarvingContext pContext, float[] pWidthFactors, double pRelativeX, double pRelativeY, double pRelativeZ, int pY) private doubleupdateVerticalRadius(CanyonCarverConfiguration pConfig, RandomSource pRandom, double pVerticalRadius, float pBranchCount, float pCurrentBranch) 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 p_224813_, CanyonCarverConfiguration p_224814_, ChunkAccess p_224815_, Function<BlockPos, Holder<Biome>> p_224816_, RandomSource p_224817_, Aquifer p_224818_, ChunkPos p_224819_, CarvingMask p_224820_) Description copied from class:WorldCarverCarves 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:
p_224815_- The chunk to be carvedp_224819_- The chunk position this carver is being called from- See Also:
-
doCarve
private void doCarve(CarvingContext pContext, CanyonCarverConfiguration pConfig, ChunkAccess pChunk, Function<BlockPos, Holder<Biome>> pBiomeAccessor, long pSeed, Aquifer pAquifer, double pX, double pY, double pZ, float pThickness, float pYaw, float pPitch, int pBranchIndex, int pBranchCount, double pHorizontalVerticalRatio, CarvingMask pCarvingMask) -
initWidthFactors
private float[] initWidthFactors(CarvingContext pContext, CanyonCarverConfiguration pConfig, RandomSource pRandom) 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 pConfig, RandomSource pRandom, double pVerticalRadius, float pBranchCount, float pCurrentBranch) -
shouldSkip
private boolean shouldSkip(CarvingContext pContext, float[] pWidthFactors, double pRelativeX, double pRelativeY, double pRelativeZ, int pY)
-