Autogeneration of some IO code

This commit is contained in:
Anuken
2020-02-13 13:30:30 -05:00
parent 47f075133f
commit ad248e2e20
40 changed files with 163 additions and 74 deletions

View File

@@ -274,14 +274,14 @@ public class ContentParser{
return block;
},
ContentType.unit, (TypeParser<UnitDef>)(mod, name, value) -> {
ContentType.unit, (TypeParser<UnitType>)(mod, name, value) -> {
readBundle(ContentType.unit, name, value);
//TODO fix
UnitDef unit;
UnitType unit;
if(locate(ContentType.unit, name) == null){
Class<Unitc> type = resolve(legacyUnitMap.get(Strings.capitalize(getType(value)), getType(value)), "mindustry.entities.type.base");
unit = new UnitDef(mod + "-" + name);
unit = new UnitType(mod + "-" + name);
}else{
unit = locate(ContentType.unit, name);
}