Files
Iris/api/src/main/java/com/volmit/service/LocateResult.java
T
piexel 05f621d82d Batch 6 part 1: one bottom-Y name, no silently-wrong defaults, geometry package, blocks
Finding 43: PackWorld.minHeight(), PlatformStart.bottomY() and StructureFit.bottomY()
become minWorldY(), the name TerrainSampler already used, and none of them has a default.
FeatureSettings.declaredBy, TerrainSampler.surfaceBlock/upperDimension and
BlockRegistry.oreFor lose defaults that answered wrong for a host that forgot them.
BlockBox, BlockPosition and BlockFace move to com.volmit.geometry.

Finding 44: BlockRegistry keeps resolve(BlockSpec) and adds find(key), which is
empty for a block the platform lacks; resolve(String) and resolve(BlockState) go.
BlockTrait drops INVENTORY, BLOCK_ENTITY and NEEDS_UPDATE, which nothing asked;
BlockAccess.is answers every trait. GenerationContext.hunk(Class) becomes blocks().
2026-10-24 05:19:06 +02:00

30 lines
1.0 KiB
Java

package com.volmit.service;
import com.volmit.geometry.BlockPosition;
import java.util.Objects;
/** How a search for something in a world ended: found at a position, not there, or given up before covering the whole
* area asked for.
*/
public sealed interface LocateResult {
LocateResult NOT_FOUND = new NotFound();
LocateResult SEARCH_LIMIT_REACHED = new SearchLimitReached();
static LocateResult found(BlockPosition position) {
return new Found(position);
}
/** Found at {@code position}: world X and Z, and Y the height above the dimension's bottom. */
record Found(BlockPosition position) implements LocateResult {
public Found {
Objects.requireNonNull(position, "position");
}
}
/** The whole area was searched and holds none. */
record NotFound() implements LocateResult {}
/** The search stopped before covering the area, such as after checking as many candidates as it allows itself. */
record SearchLimitReached() implements LocateResult {}
}