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:
parent
e3da0f713e
commit
ec2c273c97
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user