Sample terrain height for ERODE_STILT

This commit is contained in:
piexel committed 2026-10-25 22:21:33 +01:00
1 parent 46d458e6e4
commit b7499d23f2
3 files changed
+11 -9

No files matched your search

@@ -36,20 +36,13 @@ public final class PlacementModuleStilt implements PlacementModule {
PlacementModule height = switch (mode) {
case CENTER, ORGANIC, CEILING -> new PlacementModuleCenterHeight();
case MIN -> new PlacementModuleHeight(PlacementModuleHeight.Mode.MIN, fast);
case DEFAULT -> new PlacementModuleHeight(PlacementModuleHeight.Mode.MAX, fast);
case ERODE -> PlacementModuleStilt::installUnsampledHeight;
case DEFAULT, ERODE -> new PlacementModuleHeight(PlacementModuleHeight.Mode.MAX, fast);
};
height.install(lifecycle);
lifecycle.add(FILL, PlacementStage.AFTER_BLOCKS, this::fill, PlacementModuleAnchor.HEIGHT,
PlacementModuleBlocks.COMPLETE, PlacementModuleTreeGrounding.ROOTS);
}
/** The legacy runner never sampled terrain for ERODE_STILT, so surface placements keep the unset height. */
private static void installUnsampledHeight(PlacementLifecycleBuilder lifecycle) {
PlacementModuleAnchor.install(lifecycle, (context, state, ignored) -> {
});
}
private static StiltLayers stiltLayers(ObjectPlacementBake bake, PlacementPalette palette) {
int lowest = Integer.MAX_VALUE;
int highest = Integer.MIN_VALUE;