mirror of
https://github.com/VolmitSoftware/Iris.git
synced 2026-11-28 08:44:50 +00:00
Sample terrain height for ERODE_STILT
This commit is contained in:
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;
|
||||
|
||||
Reference in new issue
Block a user