sandbox is now actually sandbox again

This commit is contained in:
Anuken
2023-01-07 14:41:12 -05:00
parent 542bf2b413
commit eb410af371
+4 -3
View File
@@ -90,7 +90,7 @@ public class JsonIO{
@Override @Override
public Rules read(Json json, JsonValue jsonData, Class type){ public Rules read(Json json, JsonValue jsonData, Class type){
Rules out = new Rules(); Rules out = baseObject instanceof Rules rules ? rules : new Rules();
json.readFields(out, jsonData); json.readFields(out, jsonData);
// Older Rules data doesn't have env mapping. // Older Rules data doesn't have env mapping.
@@ -354,8 +354,9 @@ public class JsonIO{
} }
} }
private static Object baseObject;
static class CustomJson extends Json{ static class CustomJson extends Json{
private Object baseObject;
{ apply(this); } { apply(this); }
@@ -365,7 +366,7 @@ public class JsonIO{
} }
public <T> T fromBaseJson(Class<T> type, T base, String json){ public <T> T fromBaseJson(Class<T> type, T base, String json){
this.baseObject = base; baseObject = base;
return readValue(type, null, new JsonReader().parse(json)); return readValue(type, null, new JsonReader().parse(json));
} }