9
0
mirror of https://github.com/VolmitSoftware/Iris.git synced 2025-12-26 10:39:07 +00:00

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

View File

@@ -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;