Replace bridge with stream used in /ir what biome

This commit is contained in:
CocoTheOwner
2023-02-17 11:51:27 +01:00
parent 23cd5c117b
commit 110d296184
@@ -19,6 +19,8 @@
package com.volmit.iris.core.gui.components; package com.volmit.iris.core.gui.components;
import com.volmit.iris.engine.framework.Engine; 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 com.volmit.iris.util.interpolation.IrisInterpolation;
import java.awt.*; import java.awt.*;
@@ -50,12 +52,22 @@ public class IrisRenderer {
case HEIGHT -> case HEIGHT ->
colorFunction = (x, z) -> Color.getHSBColor(renderer.getComplex().getHeightStream().get(x, z).floatValue(), 100, 100).getRGB(); colorFunction = (x, z) -> Color.getHSBColor(renderer.getComplex().getHeightStream().get(x, z).floatValue(), 100, 100).getRGB();
case CONTINENT -> case CONTINENT ->
colorFunction = (x, z) -> (switch (renderer.getComplex().getBridgeStream().get(x, z)) { colorFunction = (x, z) -> {
case SHORE -> Color.YELLOW; IrisBiome b = renderer.getBiome((int) Math.round(x), renderer.getMaxHeight() - 1, (int) Math.round(z));
case LAND -> Color.GREEN; IrisBiomeGeneratorLink g = b.getGenerators().get(0);
case SEA -> Color.BLUE; Color c;
case CAVE -> Color.BLACK; if (g.getMax() <= 0) {
}).getRGB(); // 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; double x, z;