Make schematics build insulated blocks first, power nodes last (#4414)

* Make schematics build insulated blocks first, power nodes last

* Add schematicPriority property to sort by

* Assign schematicPriority of 10 to power diode
This commit is contained in:
Joshua Fan
2021-01-23 07:28:26 -08:00
committed by GitHub
parent 792fdef95d
commit 8ca08a0f14
5 changed files with 6 additions and 1 deletions

View File

@@ -285,7 +285,7 @@ public class Schematics implements Loadable{
/** Creates an array of build requests from a schematic's data, centered on the provided x+y coordinates. */
public Seq<BuildPlan> toRequests(Schematic schem, int x, int y){
return schem.tiles.map(t -> new BuildPlan(t.x + x - schem.width/2, t.y + y - schem.height/2, t.rotation, t.block, t.config).original(t.x, t.y, schem.width, schem.height))
.removeAll(s -> (!s.block.isVisible() && !(s.block instanceof CoreBlock)) || !s.block.unlockedNow());
.removeAll(s -> (!s.block.isVisible() && !(s.block instanceof CoreBlock)) || !s.block.unlockedNow()).sort(Structs.comparingInt(s -> -s.block.schematicPriority));
}
/** @return all the valid loadouts for a specific core type. */