Tecta buff / Closes Anuken/Mindustry-Suggestions/issues/4427

This commit is contained in:
Anuken
2023-05-18 00:27:01 -04:00
parent f59c439f2f
commit b611e0f9f4
4 changed files with 36 additions and 19 deletions

View File

@@ -492,10 +492,14 @@ public class Schematics implements Loadable{
}
public static void place(Schematic schem, int x, int y, Team team){
place(schem, x, y, team, true);
}
public static void place(Schematic schem, int x, int y, Team team, boolean overwrite){
int ox = x - schem.width/2, oy = y - schem.height/2;
schem.tiles.each(st -> {
Tile tile = world.tile(st.x + ox, st.y + oy);
if(tile == null) return;
if(tile == null || (!overwrite && !Build.validPlace(st.block, team, tile.x, tile.y, st.rotation))) return;
tile.setBlock(st.block, team, st.rotation);