diff --git a/core/src/mindustry/type/Item.java b/core/src/mindustry/type/Item.java index bb481dfb09..36bd65ef59 100644 --- a/core/src/mindustry/type/Item.java +++ b/core/src/mindustry/type/Item.java @@ -47,6 +47,8 @@ public class Item extends UnlockableContent implements Senseable{ /** If true, this material is used by buildings. If false, this material will be incinerated in certain cores. */ public boolean buildable = true; public boolean hidden = false; + /** For mods. Adds this item to the listed planets' hidden items Seq. */ + public @Nullable Planet[] hiddenOnPlanets; public Item(String name, Color color){ super(name); @@ -57,6 +59,17 @@ public class Item extends UnlockableContent implements Senseable{ this(name, new Color(Color.black)); } + @Override + public void init(){ + super.init(); + + if(hiddenOnPlanets != null){ + for(Planet planet : hiddenOnPlanets){ + planet.hiddenItems.add(this); + } + } + } + @Override public boolean isHidden(){ return hidden;