From df2c6541923ef1cbb47c1637809b1a15a7949568 Mon Sep 17 00:00:00 2001 From: Astrashh Date: Thu, 29 Apr 2021 16:42:00 +1000 Subject: [PATCH] Only calculate slope if slant is defined --- .../java/com/dfsek/terra/api/util/world/PaletteUtil.java | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/common/src/main/java/com/dfsek/terra/api/util/world/PaletteUtil.java b/common/src/main/java/com/dfsek/terra/api/util/world/PaletteUtil.java index c0247814c..d79fe1e9a 100644 --- a/common/src/main/java/com/dfsek/terra/api/util/world/PaletteUtil.java +++ b/common/src/main/java/com/dfsek/terra/api/util/world/PaletteUtil.java @@ -10,9 +10,11 @@ public final class PaletteUtil { public static Palette getPalette(int x, int y, int z, BiomeTemplate c, Sampler sampler) { SlantHolder slant = c.getSlant(); - double slope = MathUtil.derivative(sampler, x, y, z); - if (slant != null && slope > slant.getMinSlope()) { - return slant.getPalette(slope).getPalette(y); + if (slant != null) { + double slope = MathUtil.derivative(sampler, x, y, z); + if (slope > slant.getMinSlope()) { + return slant.getPalette(slope).getPalette(y); + } } return c.getPalette().getPalette(y);