Possible fix for notched insets

This commit is contained in:
Anuken
2020-12-02 13:02:27 -05:00
parent c26a9bd123
commit 9c616fd03b
9 changed files with 26 additions and 13 deletions

View File

@@ -83,8 +83,9 @@ public class JsonIO{
@Override
public Sector read(Json json, JsonValue jsonData, Class type){
String[] split = jsonData.asString().split("-");
return Vars.content.<Planet>getByName(ContentType.planet, split[0]).sectors.get(Integer.parseInt(split[1]));
String name = jsonData.asString();
int idx = name.lastIndexOf('-');
return Vars.content.<Planet>getByName(ContentType.planet, name.substring(0, idx)).sectors.get(Integer.parseInt(name.substring(idx + 1)));
}
});