Fixed #7728
This commit is contained in:
@@ -556,11 +556,21 @@ public class ContentParser{
|
||||
|
||||
if(!value.has("sector") || !value.get("sector").isNumber()) throw new RuntimeException("SectorPresets must have a sector number.");
|
||||
|
||||
SectorPreset out = new SectorPreset(name, locate(ContentType.planet, value.getString("planet", "serpulo")), value.getInt("sector"));
|
||||
value.remove("sector");
|
||||
value.remove("planet");
|
||||
SectorPreset out = new SectorPreset(name);
|
||||
|
||||
currentContent = out;
|
||||
read(() -> readFields(out, value));
|
||||
read(() -> {
|
||||
Planet planet = locate(ContentType.planet, value.getString("planet", "serpulo"));
|
||||
|
||||
if(planet == null) throw new RuntimeException("Planet '" + value.getString("planet") + "' not found.");
|
||||
|
||||
out.initialize(planet, value.getInt("sector", 0));
|
||||
|
||||
value.remove("sector");
|
||||
value.remove("planet");
|
||||
|
||||
readFields(out, value);
|
||||
});
|
||||
return out;
|
||||
},
|
||||
ContentType.planet, (TypeParser<Planet>)(mod, name, value) -> {
|
||||
|
||||
Reference in New Issue
Block a user