Only calculate slope if slant is defined

This commit is contained in:
Astrashh
2021-04-29 16:42:00 +10:00
parent 5542dee7b7
commit df2c654192
@@ -10,10 +10,12 @@ public final class PaletteUtil {
public static Palette getPalette(int x, int y, int z, BiomeTemplate c, Sampler sampler) {
SlantHolder slant = c.getSlant();
if (slant != null) {
double slope = MathUtil.derivative(sampler, x, y, z);
if (slant != null && slope > slant.getMinSlope()) {
if (slope > slant.getMinSlope()) {
return slant.getPalette(slope).getPalette(y);
}
}
return c.getPalette().getPalette(y);
}