Rules.hiddenBuildItems removed

This commit is contained in:
Anuken
2024-08-22 05:12:39 -04:00
parent 20ddbe9d28
commit 4cab03a1ba
6 changed files with 1 additions and 14 deletions
-3
View File
@@ -140,9 +140,6 @@ public class Logic implements ApplicationListener{
core.items.set(item, core.block.itemCapacity); core.items.set(item, core.block.itemCapacity);
} }
} }
//set up hidden items
state.rules.hiddenBuildItems.clear();
} }
//save settings //save settings
-1
View File
@@ -321,7 +321,6 @@ public class World{
state.rules.cloudColor = sector.planet.landCloudColor; state.rules.cloudColor = sector.planet.landCloudColor;
state.rules.env = sector.planet.defaultEnv; state.rules.env = sector.planet.defaultEnv;
state.rules.planet = sector.planet; state.rules.planet = sector.planet;
state.rules.hiddenBuildItems.clear();
sector.planet.applyRules(state.rules); sector.planet.applyRules(state.rules);
sector.info.resources = content.toSeq(); sector.info.resources = content.toSeq();
sector.info.resources.sort(Structs.comps(Structs.comparing(Content::getContentType), Structs.comparingInt(c -> c.id))); sector.info.resources.sort(Structs.comps(Structs.comparing(Content::getContentType), Structs.comparingInt(c -> c.id)));
-5
View File
@@ -153,11 +153,6 @@ public class Rules{
public ObjectSet<Block> revealedBlocks = new ObjectSet<>(); public ObjectSet<Block> revealedBlocks = new ObjectSet<>();
/** Unlocked content names. Only used in multiplayer when the campaign is enabled. */ /** Unlocked content names. Only used in multiplayer when the campaign is enabled. */
public ObjectSet<String> researched = new ObjectSet<>(); public ObjectSet<String> researched = new ObjectSet<>();
/**
* Block containing these items as requirements are hidden.
* @deprecated May be removed in the near future.
* */
public @Deprecated ObjectSet<Item> hiddenBuildItems = Items.erekirOnlyItems.asSet();
/** In-map objective executor. */ /** In-map objective executor. */
public MapObjectives objectives = new MapObjectives(); public MapObjectives objectives = new MapObjectives();
/** Flags set by objectives. Used in world processors. */ /** Flags set by objectives. Used in world processors. */
-1
View File
@@ -206,7 +206,6 @@ public class Planet extends UnlockableContent{
rules.attributes.add(defaultAttributes); rules.attributes.add(defaultAttributes);
rules.env = defaultEnv; rules.env = defaultEnv;
rules.planet = this; rules.planet = this;
rules.hiddenBuildItems.clear();
} }
public @Nullable Sector getLastSector(){ public @Nullable Sector getLastSector(){
@@ -338,7 +338,6 @@ public class CustomRulesDialog extends BaseDialog{
t.button("@rules.anyenv", style, () -> { t.button("@rules.anyenv", style, () -> {
rules.env = Vars.defaultEnv; rules.env = Vars.defaultEnv;
rules.hiddenBuildItems.clear();
rules.planet = Planets.sun; rules.planet = Planets.sun;
}).group(group).checked(b -> rules.planet == Planets.sun); }).group(group).checked(b -> rules.planet == Planets.sun);
}).left().fill(false).expand(false, false).row(); }).left().fill(false).expand(false, false).row();
+1 -3
View File
@@ -944,9 +944,7 @@ public class Block extends UnlockableContent implements Senseable{
} }
public boolean environmentBuildable(){ public boolean environmentBuildable(){
return return isOnPlanet(state.getPlanet());
(state.rules.hiddenBuildItems.isEmpty() || !Structs.contains(requirements, i -> state.rules.hiddenBuildItems.contains(i.item))) &&
(state.getPlanet() == null || shownPlanets.isEmpty() || shownPlanets.contains(state.getPlanet()));
} }
public boolean isStatic(){ public boolean isStatic(){