Interface CarvingContext<C>
- Type Parameters:
C- the carver's configuration type
- All Superinterfaces:
Wrapper
The carving surface handed to a CustomCarver during world generation.
Positions are absolute world coordinates unless a method says otherwise.
Only the chunk at chunkLocation() is writable and writes outside it are
silently dropped you can check with canReach(double, double, int, int, float)
- Since:
- 3.0.0
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic interfaceMirror of:net.minecraft.world.level.levelgen.carver.WorldCarver.CarveSkipChecker. -
Method Summary
Modifier and TypeMethodDescriptionbiome(int x, int y, int z) booleancanReach(double x, double z, int currentStep, int totalSteps, float thickness) Whether a carve of the given thickness could still reach the chunk being written.booleancanReplaceBlock(BlockData state) Whether the carver's replaceable set admits the given state.default booleancarveEllipsoid(double x, double y, double z, double horizontalRadius, double verticalRadius) Carves an axis-aligned ellipsoid, skipping nothing beyond its own bounds.booleancarveEllipsoid(double x, double y, double z, double horizontalRadius, double verticalRadius, CarvingContext.CarveSkipChecker skipChecker) Carves an axis-aligned ellipsoid centered on the given position, delegating to Minecraft.carveState(int x, int y, int z) Resolves the state a carve would leave at the given position: lava below the carver's lava level, otherwise the aquifer's substance.The chunk currently being written.config()The carver's configuration.intgenDepth()getBlock(int x, int y, int z) Gets the block data at the given absolute world position.default BlockDatagetBlock(BlockVector position) Gets the block data at the given absolute world position.booleanisCarved(int x, int y, int z) Whether the given absolute world position has already been carved this chunk.default booleanisOutsideChunk(int relativeX, int y, int relativeZ) booleanWhether the chunk being written is upgrading from an older format.voidmarkCarved(int x, int y, int z) Marks the given absolute world position as carved.voidmarkPosForPostProcessing(int x, int y, int z) Queues the given absolute world position for post-processing.intminGenY()random()A random source seeded for this carve.voidSets a block at the given absolute world position.default voidsetBlock(BlockVector position, BlockData data) Sets a block at the given absolute world position.booleanThe chunk this carve originated from.topMaterial(int x, int y, int z, boolean underFluid) Deprecated.Deprecated in Minecraft.Methods inherited from interface Wrapper
asHandle, toMinecraft, unwrap
-
Method Details
-
config
-
random
-
sourceChunk
The chunk this carve originated from. Not necessarily the chunk being written.- Returns:
- the source chunk location
- Since:
- 3.0.0
-
chunkLocation
The chunk currently being written.- Returns:
- the target chunk location
- Since:
- 3.0.0
-
minGenY
- Returns:
- the lowest y-level generation may produce
- Since:
- 3.0.0
-
genDepth
- Returns:
- the total height of the generation region
- Since:
- 3.0.0
-
carveEllipsoid
@AsOf("3.0.0") boolean carveEllipsoid(double x, double y, double z, double horizontalRadius, double verticalRadius, CarvingContext.CarveSkipChecker skipChecker) Carves an axis-aligned ellipsoid centered on the given position, delegating to Minecraft. Blocks resolve to lava below the carver's lava level and to the aquifer's substance elsewhere; surface material is reapplied to exposed dirt. Positions the checker rejects are left alone.- Returns:
- whether any block was carved
- Since:
- 3.0.0
-
carveEllipsoid
@AsOf("3.0.0") default boolean carveEllipsoid(double x, double y, double z, double horizontalRadius, double verticalRadius) Carves an axis-aligned ellipsoid, skipping nothing beyond its own bounds.- Returns:
- whether any block was carved
- Since:
- 3.0.0
-
canReach
@AsOf("3.0.0") boolean canReach(double x, double z, int currentStep, int totalSteps, float thickness) Whether a carve of the given thickness could still reach the chunk being written. Walks that keep stepping past a false return waste work.- Returns:
- whether the chunk is still reachable
- Since:
- 3.0.0
-
carveState
-
shouldScheduleFluidUpdate
-
getBlock
-
getBlock
Gets the block data at the given absolute world position.- Returns:
- the block data currently at that position
- Since:
- 3.0.0
-
setBlock
-
biome
-
setBlock
Sets a block at the given absolute world position.- Since:
- 3.0.0
-
isCarved
Whether the given absolute world position has already been carved this chunk.- Returns:
- whether the position is masked
- Since:
- 3.0.0
-
markCarved
Marks the given absolute world position as carved. Positions outside the chunk being written are ignored.- Since:
- 3.0.0
-
canReplaceBlock
-
isUpgrading
Whether the chunk being written is upgrading from an older format.- Returns:
- whether the chunk is upgrading
- Since:
- 3.0.0
-
markPosForPostProcessing
Queues the given absolute world position for post-processing. Required after placing a fluid by hand.- Since:
- 3.0.0
-
topMaterial
Deprecated.Deprecated in Minecraft.Resolves the surface material the biome's surface rule would place at the given absolute world position.- Returns:
- the surface material, or empty if the surface rule declines
- Since:
- 3.0.0
-
isOutsideChunk
-