This commit is contained in:
Anuken 2020-10-09 19:10:16 -04:00
parent 5455ef4361
commit 5a31d419fc
2 changed files with 54 additions and 53 deletions

View File

@ -33,6 +33,7 @@ import mindustry.world.draw.*;
import mindustry.world.meta.*;
import java.lang.reflect.*;
import java.util.*;
@SuppressWarnings("unchecked")
public class ContentParser{
@ -554,10 +555,13 @@ public class ContentParser{
private void readFields(Object object, JsonValue jsonMap, boolean stripType){
if(stripType) jsonMap.remove("type");
if(object instanceof UnlockableContent unlock){
JsonValue research = jsonMap.remove("research");
readFields(object, jsonMap);
if(object instanceof UnlockableContent unlock && research != null){
//add research tech node
if(research != null){
String researchName;
ItemStack[] customRequirements;
@ -603,11 +607,8 @@ public class ContentParser{
//reparent the node
node.parent = parent;
});
}
}
readFields(object, jsonMap);
}
void readFields(Object object, JsonValue jsonMap){
toBeParsed.remove(object);