Batch 2 of the API review: settings stacks, chunk helpers, pack context

- SettingsStack<F> replaces List<Entry<F>> wherever settings stack:
  entries in level order, values(), dimension(), level(Level) and
  mostSpecific().
- com.volmit.config.Level replaces FeatureAttachment.Target;
  FeatureAttachment folds into FeatureDescriptor.targets().
- FeatureSettings.declaredInChunk answers every entry any column of a
  chunk declares, each once.
- ChunkContext gives chunkX/chunkZ, centreX/centreZ and area().
- registerSettings takes several types at once.
- ModuleLifecycle.packLoaded(PackContext) carries resources, settings
  and the module's log.
- TerrainSampler.surfaceHeight gives the surface in whole blocks.
- Stage contexts drop worldSeed() and resources(); world() always
  answers. The scoped world is kept per world and module.
- Javadoc fixes; README, DESIGN and CONTRACTS updated.
This commit is contained in:
piexel committed 2026-10-23 14:17:19 +02:00
1 parent 1677f4414b
commit 7143908d4b
67 files changed
+870 -423

No files matched your search

@@ -2,20 +2,18 @@ package com.volmit.host;
import com.volmit.IrisFeature;
import com.volmit.config.FeatureSettings;
import com.volmit.config.FeatureSettings.Entry;
import com.volmit.config.SettingsStack;
import com.volmit.object.ObjectBlock;
import com.volmit.object.ObjectTransformer;
import com.volmit.placement.PlacementAccess;
import com.volmit.placement.PlacementContext;
import com.volmit.placement.PlacementRequest;
import com.volmit.random.WorldRandom;
import com.volmit.resource.PackResources;
import com.volmit.world.PackWorld;
import com.volmit.stage.BlockStageContext;
import com.volmit.stage.Stage;
import com.volmit.world.BlockView;
import com.volmit.world.TerrainSampler;
import java.util.List;
import java.util.Objects;
/** The context every stage of one placement attempt receives. Block accessors work only while
@@ -74,7 +72,7 @@ final class PlacementInvocation implements BlockStageContext {
}
@Override
public <S extends IrisFeature> List<Entry<S>> configured(Class<S> settingsType) {
public <S extends IrisFeature> SettingsStack<S> configured(Class<S> settingsType) {
return stages.configured(settingsType);
}
@@ -115,21 +113,11 @@ final class PlacementInvocation implements BlockStageContext {
blockStatus = BlockStatus.SKIPPED;
}
@Override
public long worldSeed() {
return inputs.worldSeed();
}
@Override
public PackWorld world() {
return stages.world(inputs.world());
}
@Override
public PackResources resources() {
return inputs.resources();
}
@Override
public WorldRandom random() {
return stages.random();