Adapt getHeight complex function to negative limits

This commit is contained in:
LLIcocoman 2022-02-07 10:45:16 +01:00
parent 0b77986034
commit 525dfab3e3
2 changed files with 7 additions and 3 deletions

View File

@ -95,7 +95,7 @@ public class IrisComplex implements DataProvider {
UUID focusUUID = UUID.nameUUIDFromBytes("focus".getBytes()); UUID focusUUID = UUID.nameUUIDFromBytes("focus".getBytes());
this.rng = new RNG(engine.getSeedManager().getComplex()); this.rng = new RNG(engine.getSeedManager().getComplex());
this.data = engine.getData(); this.data = engine.getData();
double height = engine.getHeight(); double height = engine.getMaxHeight();
fluidHeight = engine.getDimension().getFluidHeight(); fluidHeight = engine.getDimension().getFluidHeight();
generators = new KMap<>(); generators = new KMap<>();
focusBiome = engine.getFocus(); focusBiome = engine.getFocus();
@ -336,8 +336,8 @@ public class IrisComplex implements DataProvider {
} }
private double getHeight(Engine engine, IrisBiome b, double x, double z, long seed) { private double getHeight(Engine engine, IrisBiome b, double x, double z, long seed) {
return Math.min(engine.getHeight(), return Math.min(engine.getWorld().maxHeight(),
Math.max(getInterpolatedHeight(engine, x, z, seed) + fluidHeight + overlayStream.get(x, z), 0)); Math.max(getInterpolatedHeight(engine, x, z, seed) + fluidHeight + overlayStream.get(x, z), engine.getWorld().minHeight()));
} }
private void registerGenerator(IrisGenerator cachedGenerator) { private void registerGenerator(IrisGenerator cachedGenerator) {

View File

@ -136,6 +136,10 @@ public interface Engine extends DataProvider, Fallible, LootProvider, BlockUpdat
EngineTarget getTarget(); EngineTarget getTarget();
default int getMaxHeight() {
return getTarget().getWorld().maxHeight();
}
default int getMinHeight() { default int getMinHeight() {
return getTarget().getWorld().minHeight(); return getTarget().getWorld().minHeight();
} }