Merge branch 'master' into master

This commit is contained in:
Brian Fopiano 2022-02-09 13:43:50 -08:00 committed by GitHub
commit e071ecc1d7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 9 additions and 3 deletions

View File

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

View File

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

View File

@ -76,6 +76,8 @@ public class IrisEntitySpawn implements IRare {
int z = (c.getZ() * 16) + rng.i(15);
int h = gen.getHeight(x, z, true) - 64;
int hf = gen.getHeight(x, z, false) - 64;
//int h = gen.getHeight(x, z, true) + gen.getWorld().minHeight(); Will look into this later
//int hf = gen.getHeight(x, z, false) + gen.getWorld().minHeight();
Location l = switch(getReferenceSpawner().getGroup()) {
case NORMAL -> new Location(c.getWorld(), x, hf + 1, z);
case CAVE -> gen.getMantle().findMarkers(c.getX(), c.getZ(), MarkerMatter.CAVE_FLOOR)