From ec2c273c9784c6aea3339ed64b8a0d0d96c5b9ed Mon Sep 17 00:00:00 2001 From: Anuken Date: Wed, 9 Jun 2021 22:55:48 -0400 Subject: [PATCH] Add an automatic item produce requirement --- core/src/mindustry/mod/ContentParser.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/core/src/mindustry/mod/ContentParser.java b/core/src/mindustry/mod/ContentParser.java index 6738257d79..6862b1a540 100644 --- a/core/src/mindustry/mod/ContentParser.java +++ b/core/src/mindustry/mod/ContentParser.java @@ -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);