diff --git a/src/main/java/com/volmit/iris/core/gui/components/IrisRenderer.java b/src/main/java/com/volmit/iris/core/gui/components/IrisRenderer.java index 23928b329..d1f2ca751 100644 --- a/src/main/java/com/volmit/iris/core/gui/components/IrisRenderer.java +++ b/src/main/java/com/volmit/iris/core/gui/components/IrisRenderer.java @@ -19,6 +19,8 @@ package com.volmit.iris.core.gui.components; import com.volmit.iris.engine.framework.Engine; +import com.volmit.iris.engine.object.IrisBiome; +import com.volmit.iris.engine.object.IrisBiomeGeneratorLink; import com.volmit.iris.util.interpolation.IrisInterpolation; import java.awt.*; @@ -50,12 +52,22 @@ public class IrisRenderer { case HEIGHT -> colorFunction = (x, z) -> Color.getHSBColor(renderer.getComplex().getHeightStream().get(x, z).floatValue(), 100, 100).getRGB(); case CONTINENT -> - colorFunction = (x, z) -> (switch (renderer.getComplex().getBridgeStream().get(x, z)) { - case SHORE -> Color.YELLOW; - case LAND -> Color.GREEN; - case SEA -> Color.BLUE; - case CAVE -> Color.BLACK; - }).getRGB(); + colorFunction = (x, z) -> { + IrisBiome b = renderer.getBiome((int) Math.round(x), renderer.getMaxHeight() - 1, (int) Math.round(z)); + IrisBiomeGeneratorLink g = b.getGenerators().get(0); + Color c; + if (g.getMax() <= 0) { + // Max is below water level, so it is most likely an ocean biome + c = Color.BLUE; + } else if (g.getMin() < 0) { + // Min is below water level, but max is not, so it is most likely a shore biome + c = Color.YELLOW; + } else { + // Both min and max are above water level, so it is most likely a land biome + c = Color.GREEN; + } + return c.getRGB(); + }; } double x, z;