mirror of
https://github.com/VolmitSoftware/Iris.git
synced 2026-11-29 09:15:27 +00:00
Report seams and defer areas
- RIVER_FLUID reports the seam of a river fluid whose blocks match the exported dimension fluid - River export areas are built only after the hydrology enabled and density checks pass - Tests cover matching-fluid seams, an unknown policy fluid failing the export, deferred area building, and the stage's exported-biome filter with child traversal
This commit is contained in:
1 parent
8e048944ec
commit
549eaa7e20
5 files changed
+84
-7
No files matched your search
+3
-2
@@ -19,6 +19,7 @@ import art.arcane.iris.pack.datapack.export.lower.ExportCapabilities;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
import java.util.function.Supplier;
|
||||
|
||||
public final class RiverCompiler {
|
||||
public static final String CARVED_HEIGHT = "height/carved";
|
||||
@@ -61,7 +62,7 @@ public final class RiverCompiler {
|
||||
this.diagnostics = Objects.requireNonNull(diagnostics, "diagnostics");
|
||||
}
|
||||
|
||||
public Field compile(Field height, IrisDimension dimension, List<Area> areas, NoiseRegistry registry, ExportCapabilities capabilities) {
|
||||
public Field compile(Field height, IrisDimension dimension, Supplier<List<Area>> areas, NoiseRegistry registry, ExportCapabilities capabilities) {
|
||||
Objects.requireNonNull(height, "height");
|
||||
Objects.requireNonNull(areas, "areas");
|
||||
IrisHydrology hydrology = dimension.getHydrology();
|
||||
@@ -76,7 +77,7 @@ public final class RiverCompiler {
|
||||
return height;
|
||||
}
|
||||
report(ExportLimit.RIVER_DRAINAGE, resource, "Rivers follow seeded noise channels instead of drainage: tributaries cross instead of joining and widths follow elevation");
|
||||
diagnostics.addAll(RiverLimits.diagnostics(dimension, settings, areas, resource));
|
||||
diagnostics.addAll(RiverLimits.diagnostics(dimension, settings, areas.get(), resource));
|
||||
Field elevation = FieldMacros.sum(List.of(height, new Field.Const(-fluidHeight)));
|
||||
Carving carving = new Carving(elevation, variation(registry), bankNoise(settings.deformation(), registry), settings.deformation(), registry, capabilities);
|
||||
List<HydrologyTier> tiers = settings.tiers();
|
||||
|
||||
+7
-4
@@ -140,12 +140,15 @@ final class RiverLimits {
|
||||
}
|
||||
|
||||
private void fluid(Owner owner, String name) {
|
||||
if (exported(settings.fluids().get(name))) {
|
||||
String seam = settings.seams().get(name);
|
||||
if (!exported(settings.fluids().get(name))) {
|
||||
String subject = seam == null ? "Fluid '" + name + "' is" : "Fluid '" + name + "' and its seam '" + seam + "' are";
|
||||
add(ExportLimit.RIVER_FLUID, owner, name, subject + " not exported: rivers fill with " + exportFluid + " up to fluidHeight");
|
||||
return;
|
||||
}
|
||||
String seam = settings.seams().get(name);
|
||||
String subject = seam == null ? "Fluid '" + name + "' is" : "Fluid '" + name + "' and its seam '" + seam + "' are";
|
||||
add(ExportLimit.RIVER_FLUID, owner, name, subject + " not exported: rivers fill with " + exportFluid + " up to fluidHeight");
|
||||
if (seam != null) {
|
||||
add(ExportLimit.RIVER_FLUID, owner, name, "Seam '" + seam + "' of fluid '" + name + "' is not exported: rivers have no seam band at their edges");
|
||||
}
|
||||
}
|
||||
|
||||
private boolean exported(IrisMaterialPalette palette) {
|
||||
|
||||
+1
-1
@@ -29,7 +29,7 @@ public final class RiverStage implements CompileStage {
|
||||
@Override
|
||||
public void apply(PackCompileContext context) {
|
||||
Field natural = context.naturalHeight();
|
||||
Field carved = new RiverCompiler(context.diagnostics()).compile(natural, context.dimension(), areas(context), context.noises(), context.capabilities());
|
||||
Field carved = new RiverCompiler(context.diagnostics()).compile(natural, context.dimension(), () -> areas(context), context.noises(), context.capabilities());
|
||||
context.setCarvedHeight(carved);
|
||||
context.setSurfaceEstimate(FieldMacros.substitute(carved, natural, context.climateHeight(), ESTIMATE_TAG));
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user