1
0
mirror of https://github.com/Anuken/Mindustry.git synced 2024-11-10 15:05:23 +03:00

Add an automatic item produce requirement

This commit is contained in:
Anuken 2021-06-09 22:55:48 -04:00
parent e3da0f713e
commit ec2c273c97

View File

@ -707,6 +707,11 @@ public class ContentParser{
node.objectives.addAll(parser.readValue(Objective[].class, research.get("objectives")));
}
//all items have a produce requirement unless already specified
if(object instanceof Item i && !node.objectives.contains(o -> o instanceof Produce p && p.content == i)){
node.objectives.add(new Produce(i));
}
//remove old node from parent
if(node.parent != null){
node.parent.children.remove(node);