some JSON fixes

This commit is contained in:
Anuken
2022-05-22 22:27:53 -04:00
parent 2236771b22
commit 6d9029fb23

View File

@@ -108,9 +108,9 @@ public class ContentParser{
if(data.isString()){ if(data.isString()){
return field(Bullets.class, data); return field(Bullets.class, data);
} }
var bc = resolve(data.getString("type", ""), BasicBulletType.class); Class<?> bc = resolve(data.getString("type", ""), BasicBulletType.class);
data.remove("type"); data.remove("type");
BulletType result = make(bc); BulletType result = (BulletType)make(bc);
readFields(result, data); readFields(result, data);
return result; return result;
}); });
@@ -150,7 +150,7 @@ public class ContentParser{
return result; return result;
}); });
put(DrawPart.class, (type, data) -> { put(DrawPart.class, (type, data) -> {
var bc = resolve(data.getString("type", ""), RegionPart.class); Class<?> bc = resolve(data.getString("type", ""), RegionPart.class);
data.remove("type"); data.remove("type");
var result = make(bc); var result = make(bc);
readFields(result, data); readFields(result, data);