SunMesh support for JSON planets (#8882)
* Single-color SunMesh support * This should work now * No more crap code
This commit is contained in:
@@ -879,6 +879,17 @@ public class ContentParser{
|
||||
Color.valueOf(data.getString("color2", data.getString("color", "ffffff"))),
|
||||
data.getInt("colorOct", 1), data.getFloat("colorPersistence", 0.5f), data.getFloat("colorScale", 1f),
|
||||
data.getFloat("colorThreshold", 0.5f));
|
||||
case "SunMesh" -> {
|
||||
var cvals = data.get("colors").asStringArray();
|
||||
var colors = new Color[cvals.length];
|
||||
for(int i=0; i<cvals.length; i++){
|
||||
colors[i] = Color.valueOf(cvals[i]);
|
||||
}
|
||||
|
||||
yield new SunMesh(planet, data.getInt("divisions", 1), data.getInt("octaves", 1), data.getFloat("persistence", 0.5f),
|
||||
data.getFloat("scl", 1f), data.getFloat("pow", 1f), data.getFloat("mag", 0.5f),
|
||||
data.getFloat("colorScale", 1f), colors);
|
||||
}
|
||||
case "HexSkyMesh" -> new HexSkyMesh(planet,
|
||||
data.getInt("seed", 0), data.getFloat("speed", 0), data.getFloat("radius", 1f),
|
||||
data.getInt("divisions", 3), Color.valueOf(data.getString("color", "ffffff")), data.getInt("octaves", 1),
|
||||
|
||||
Reference in New Issue
Block a user