mirror of
https://github.com/VolmitSoftware/Iris.git
synced 2025-07-18 18:23:06 +00:00
Merge pull request #743 from ValkrysFr/master
Hot fix mob spawning height
This commit is contained in:
commit
14f6ef3da0
@ -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) {
|
||||||
|
@ -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();
|
||||||
}
|
}
|
||||||
|
@ -74,8 +74,8 @@ public class IrisEntitySpawn implements IRare {
|
|||||||
for(int id = 0; id < spawns; id++) {
|
for(int id = 0; id < spawns; id++) {
|
||||||
int x = (c.getX() * 16) + rng.i(15);
|
int x = (c.getX() * 16) + rng.i(15);
|
||||||
int z = (c.getZ() * 16) + rng.i(15);
|
int z = (c.getZ() * 16) + rng.i(15);
|
||||||
int h = gen.getHeight(x, z, true);
|
int h = gen.getHeight(x, z, true) + gen.getWorld().minHeight();
|
||||||
int hf = gen.getHeight(x, z, false);
|
int hf = gen.getHeight(x, z, false) + gen.getWorld().minHeight();
|
||||||
Location l = switch(getReferenceSpawner().getGroup()) {
|
Location l = switch(getReferenceSpawner().getGroup()) {
|
||||||
case NORMAL -> new Location(c.getWorld(), x, hf + 1, z);
|
case NORMAL -> new Location(c.getWorld(), x, hf + 1, z);
|
||||||
case CAVE -> gen.getMantle().findMarkers(c.getX(), c.getZ(), MarkerMatter.CAVE_FLOOR)
|
case CAVE -> gen.getMantle().findMarkers(c.getX(), c.getZ(), MarkerMatter.CAVE_FLOOR)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user