Hide Items on Planets Field (#7550)

* Hide item on planet field

* Better name, Planet[] instead of String[]

* a
This commit is contained in:
MEEPofFaith
2022-09-16 09:20:43 -07:00
committed by GitHub
parent 2c00365701
commit 9d6b08a15d

View File

@@ -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;