Better weather classes
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user