Batch 7 stage 4a: biome height, sky biome and platform biome writes

TerrainSampler.biomeHeight and skyBiome answer for a pack biome at any
column; Mantle.setPlatformBiome makes a block show a platform biome, inside
a chunk stage's own chunk. These replace the module's FloatingHost facade.
README, DESIGN (ledger drops FloatingHost) and CONTRACTS updated.
This commit is contained in:
piexel committed 2026-10-28 01:58:46 +01:00
1 parent f1eb619344
commit 95582abb6e
9 files changed
+79 -2

No files matched your search

@@ -2,6 +2,7 @@ package com.volmit.mantle;
import com.volmit.block.BlockState;
import com.volmit.geometry.BlockBox;
import com.volmit.resource.ResourceId;
/**
* Invocation-scoped access to typed mantle data. X and Z are world block coordinates; Y is
@@ -39,6 +40,13 @@ public interface Mantle {
*/
boolean isCarved(int x, int y, int z);
/** Shows the block as platform biome {@code biome}, such as {@code minecraft:plains} or a pack's custom biome, instead
* of the biome its column generates as; the host's biome pass reads it when it writes the chunk's biomes. The host
* owns this layer and keeps it in its own form, so it is written only and needs no registration. A chunk stage
* sets it inside its own chunk only, like module layers.
*/
void setPlatformBiome(int x, int y, int z, ResourceId biome);
/** Only one edit may be active per view. Parent reads remain allowed, but parent
* mutations are prohibited until the edit ends (IllegalStateException).
*/
@@ -69,6 +69,19 @@ public interface TerrainSampler {
*/
Optional<BlockState> surfaceBlock(int worldX, int worldZ);
/** The height, above the bottom, that the terrain generators of pack biome {@code biome} give the column when shaped
* with {@code seed}, whatever biome the column really has: what a biome's ground would be if it stood there. Throws
* IllegalArgumentException when the pack has no such biome. Outside the bounds it throws like {@link #column}.
*/
double biomeHeight(ResourceId biome, int worldX, int worldZ, long seed);
/** The platform biome pack biome {@code biome} shows as when it floats in the sky at the column, such as
* {@code minecraft:plains}: one of its custom biomes, or a pick from its sky scatter. Empty when the biome names
* none. Throws IllegalArgumentException when the pack has no such biome. Outside the bounds it throws like
* {@link #column}. Write it with {@link com.volmit.mantle.Mantle#setPlatformBiome}.
*/
Optional<ResourceId> skyBiome(ResourceId biome, int worldX, int worldZ);
/** The Y in the world of the dimension's bottom block, such as {@code -64}: what to add to a height above the bottom
* to get the Y a pack's settings name when they speak of world heights.
*/