From 6e53d7b723845b05598daca8a130e6041046c02f Mon Sep 17 00:00:00 2001 From: piexel Date: Mon, 12 Oct 2026 02:19:48 +0200 Subject: [PATCH] TerrainSampler.surfaceBiome: the id of a column's surface biome alone --- src/main/java/com/volmit/world/TerrainSampler.java | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/main/java/com/volmit/world/TerrainSampler.java b/src/main/java/com/volmit/world/TerrainSampler.java index f3cb3217b..474b7fa74 100644 --- a/src/main/java/com/volmit/world/TerrainSampler.java +++ b/src/main/java/com/volmit/world/TerrainSampler.java @@ -1,6 +1,7 @@ package com.volmit.world; import com.volmit.block.BlockState; +import com.volmit.resource.ResourceId; import com.volmit.mantle.BlockBox; import java.util.Optional; import java.util.OptionalInt; @@ -33,6 +34,13 @@ public interface TerrainSampler { */ OptionalInt upperDimensionY(int worldX, int worldZ); + /** The id of the column's surface biome, as {@link BiomeSample#surfaceBiome()} gives it, for a module that asks about every + * column of a chunk and has no use for the rest of the sample. The host may answer it without working out the cave biome. + */ + default ResourceId surfaceBiome(int worldX, int worldZ) { + return biome(worldX, bounds().minY(), worldZ).surfaceBiome(); + } + /** What the surface biome of the column was generated as. A cave biome ({@link BiomeSample#caveBiome()}) is always * {@link BiomeKind#CAVE}, so the answer is about the surface biome only. Outside the bounds it throws like {@link #column}. */