Better weather classes

This commit is contained in:
Anuken
2020-10-19 16:25:59 -04:00
parent cab08de1f7
commit 6e8732387b
12 changed files with 332 additions and 329 deletions

View File

@@ -303,6 +303,20 @@ public class ContentParser{
return unit;
},
ContentType.weather, (TypeParser<Weather>)(mod, name, value) -> {
Weather item;
if(locate(ContentType.weather, name) != null){
item = locate(ContentType.weather, name);
readBundle(ContentType.weather, name, value);
}else{
readBundle(ContentType.weather, name, value);
Class<? extends Weather> type = resolve(getType(value), "mindustry.type.weather");
item = make(type);
}
currentContent = item;
read(() -> readFields(item, value));
return item;
},
ContentType.item, parser(ContentType.item, Item::new),
ContentType.liquid, parser(ContentType.liquid, Liquid::new)
//ContentType.sector, parser(ContentType.sector, SectorPreset::new)