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 TypeMethodDescriptionboolean
carve
(CarvingContext pContext, CanyonCarverConfiguration pConfig, ChunkAccess pChunk, Function<BlockPos, Holder<Biome>> pBiomeAccessor, RandomSource pRandom, Aquifer pAquifer, ChunkPos pChunkPos, CarvingMask pCarvingMask) Carves the given chunk with caves that originate from the givenchunkPos
.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) 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.boolean
isStartChunk
(CanyonCarverConfiguration pConfig, RandomSource pRandom) private boolean
shouldSkip
(CarvingContext pContext, float[] pWidthFactors, double pRelativeX, double pRelativeY, double pRelativeZ, int pY) private double
updateVerticalRadius
(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:
isStartChunk
in classWorldCarver<CanyonCarverConfiguration>
-
carve
public boolean carve(CarvingContext pContext, CanyonCarverConfiguration pConfig, ChunkAccess pChunk, Function<BlockPos, Holder<Biome>> pBiomeAccessor, RandomSource pRandom, Aquifer pAquifer, ChunkPos pChunkPos, CarvingMask pCarvingMask) 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:
carve
in classWorldCarver<CanyonCarverConfiguration>
- Parameters:
pChunk
- The chunk to be carvedpChunkPos
- 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)
-