Prevent locked block replacement

This commit is contained in:
Anuken
2019-11-01 19:23:01 -04:00
parent ad23cbc03c
commit 59401ab5f5
3 changed files with 13 additions and 3 deletions
@@ -228,7 +228,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 Array<BuildRequest> toRequests(Schematic schem, int x, int y){
return schem.tiles.map(t -> new BuildRequest(t.x + x - schem.width/2, t.y + y - schem.height/2, t.rotation, t.block).original(t.x, t.y, schem.width, schem.height).configure(t.config))
.removeAll(s -> !s.block.isVisible() || (!s.block.unlocked() && world.isZone()));
.removeAll(s -> !s.block.isVisible() || !s.block.unlockedCur());
}
/** Adds a schematic to the list, also copying it into the files.*/