Support for JSON planets without a parent
This commit is contained in:
@@ -268,6 +268,7 @@ abstract class UnitComp implements Healthc, Physicsc, Hitboxc, Statusc, Teamc, I
|
|||||||
kill();
|
kill();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
case shield -> shield = Math.max((float)value, 0f);
|
||||||
case x -> x = World.unconv((float)value);
|
case x -> x = World.unconv((float)value);
|
||||||
case y -> y = World.unconv((float)value);
|
case y -> y = World.unconv((float)value);
|
||||||
case rotation -> rotation = (float)value;
|
case rotation -> rotation = (float)value;
|
||||||
|
|||||||
@@ -596,7 +596,7 @@ public class ContentParser{
|
|||||||
ContentType.planet, (TypeParser<Planet>)(mod, name, value) -> {
|
ContentType.planet, (TypeParser<Planet>)(mod, name, value) -> {
|
||||||
if(value.isString()) return locate(ContentType.planet, name);
|
if(value.isString()) return locate(ContentType.planet, name);
|
||||||
|
|
||||||
Planet parent = locate(ContentType.planet, value.getString("parent"));
|
Planet parent = locate(ContentType.planet, value.getString("parent", ""));
|
||||||
Planet planet = new Planet(mod + "-" + name, parent, value.getFloat("radius", 1f), value.getInt("sectorSize", 0));
|
Planet planet = new Planet(mod + "-" + name, parent, value.getFloat("radius", 1f), value.getInt("sectorSize", 0));
|
||||||
|
|
||||||
if(value.has("mesh")){
|
if(value.has("mesh")){
|
||||||
|
|||||||
Reference in New Issue
Block a user