Water objects use hydrology

- Hydrology support gate applies only to land placements; underwater, onwater and forcePlace skip it
- Underwater and onwater anchors use the hydrology bed and head through the existing sea checks
- Automatic placements throw when any height or water answer before the block pass was provisional
- PlacementModuleSurfaceSupportTest covers ponds, rivers, forcePlace, dry columns and provisional water
- Drop the test that kept forcePlace out of river water
This commit is contained in:
Brian Neumann-Fopiano committed 2026-11-02 04:43:11 -05:00
1 parent 217da03ef6
commit 2d52cc409e
4 files changed
+313 -12

No files matched your search

@@ -1,5 +1,6 @@
package art.arcane.iris.structure.object;
import art.arcane.iris.generation.stream.ProvisionalSampling;
import java.util.List;
@@ -15,9 +16,11 @@ public final class PlacementLifecycle {
/** The block pass and everything after it read one consistent object snapshot. */
public PlacementState execute(PlacementContext context) {
PlacementState state = new PlacementState(context);
long revision = ProvisionalSampling.revision();
for (PlacementStage<Void> stage : PlacementStage.BEFORE_PASS) {
run(stage, context, state, null);
}
requireFinalAnswers(context, revision);
if (state.isRejected()) {
return state;
}
@@ -42,4 +45,13 @@ public final class PlacementLifecycle {
function.execute(context, state, input);
}
}
private static void requireFinalAnswers(PlacementContext context, long revision) {
if (context.yv >= 0 || ProvisionalSampling.revision() == revision) {
return;
}
String key = context.self.getLoadKey();
throw new IllegalStateException("Object " + (key == null ? "<no loadKey>" : key) + " at " + context.x + "," + context.z
+ " read a provisional terrain or water answer; automatic placements are only made from final terrain.");
}
}
@@ -15,7 +15,8 @@ final class PlacementModuleSurfaceSupport implements PlacementModule {
public void install(PlacementLifecycleBuilder lifecycle) {
lifecycle.add(CHECK, PlacementStage.VALIDATE, (context, state, ignored) -> {
IrisObjectPlacement config = state.config;
if (context.yv < 0 && config.getCarvingSupport().supportsSurface()
if (context.yv < 0 && !config.isForcePlace() && !config.isUnderwater() && !config.isOnwater()
&& config.getCarvingSupport().supportsSurface()
&& config.getMode() != ObjectPlaceMode.FLOATING && config.getMode() != ObjectPlaceMode.STRUCTURE_PIECE
&& (state.paintProjection != null
? IrisSurfaceSupport.intersectsHydrology(context.placer, context.x, context.z, null, null, 0, 0, 0, state.paintSupport)