mirror of
https://github.com/PolyhedralDev/Terra.git
synced 2025-07-18 10:32:30 +00:00
Fix stoopid NPE
This commit is contained in:
parent
cab91ec15b
commit
00c933c06e
@ -22,6 +22,7 @@ public class AirSpawn extends Requirement {
|
|||||||
BiomeConfig c = wc.getBiome(b);
|
BiomeConfig c = wc.getBiome(b);
|
||||||
if(y <= c.getOcean().getSeaLevel()) return false;
|
if(y <= c.getOcean().getSeaLevel()) return false;
|
||||||
ElevationEquation elevationEquation = ((UserDefinedGenerator) b.getGenerator()).getElevationEquation();
|
ElevationEquation elevationEquation = ((UserDefinedGenerator) b.getGenerator()).getElevationEquation();
|
||||||
return b.getGenerator().getNoise(getNoise(), getWorld(), x, (int) (y - elevationEquation.getNoise(x, z, getWorld())), z) <= 0;
|
int yf = y - ((elevationEquation == null) ? 0 : (int) elevationEquation.getNoise(x, z, getWorld()));
|
||||||
|
return b.getGenerator().getNoise(getNoise(), getWorld(), x, yf, z) <= 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -17,6 +17,7 @@ public class LandSpawn extends Requirement {
|
|||||||
TerraWorld tw = TerraWorld.getWorld(getWorld());
|
TerraWorld tw = TerraWorld.getWorld(getWorld());
|
||||||
UserDefinedBiome b = (UserDefinedBiome) tw.getGrid().getBiome(x, z, GenerationPhase.POPULATE);
|
UserDefinedBiome b = (UserDefinedBiome) tw.getGrid().getBiome(x, z, GenerationPhase.POPULATE);
|
||||||
ElevationEquation elevationEquation = ((UserDefinedGenerator) b.getGenerator()).getElevationEquation();
|
ElevationEquation elevationEquation = ((UserDefinedGenerator) b.getGenerator()).getElevationEquation();
|
||||||
return b.getGenerator().getNoise(getNoise(), getWorld(), x, (int) (y - elevationEquation.getNoise(x, z, getWorld())), z) > 0;
|
int yf = y - ((elevationEquation == null) ? 0 : (int) elevationEquation.getNoise(x, z, getWorld()));
|
||||||
|
return b.getGenerator().getNoise(getNoise(), getWorld(), x, yf, z) > 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -20,6 +20,7 @@ public class OceanSpawn extends Requirement {
|
|||||||
BiomeConfig c = tw.getConfig().getBiome(b);
|
BiomeConfig c = tw.getConfig().getBiome(b);
|
||||||
if(y > c.getOcean().getSeaLevel()) return false;
|
if(y > c.getOcean().getSeaLevel()) return false;
|
||||||
ElevationEquation elevationEquation = ((UserDefinedGenerator) b.getGenerator()).getElevationEquation();
|
ElevationEquation elevationEquation = ((UserDefinedGenerator) b.getGenerator()).getElevationEquation();
|
||||||
return b.getGenerator().getNoise(getNoise(), getWorld(), x, (int) (y - elevationEquation.getNoise(x, z, getWorld())), z) <= 0;
|
int yf = y - ((elevationEquation == null) ? 0 : (int) elevationEquation.getNoise(x, z, getWorld()));
|
||||||
|
return b.getGenerator().getNoise(getNoise(), getWorld(), x, yf, z) <= 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user