Made save format support removed blocks

This commit is contained in:
Anuken
2020-06-04 14:50:08 -04:00
parent f112226178
commit 803f9e8eb6
12 changed files with 103 additions and 13 deletions

View File

@@ -393,6 +393,22 @@ public class Schematics implements Loadable{
});
}
public static void place(Schematic schem, int x, int y, Team team){
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;
tile.setBlock(st.block, team, 0);
tile.rotation(st.rotation);
Object config = st.config;
if(tile.entity != null){
tile.entity.configureAny(config);
}
});
}
//region IO methods
/** Loads a schematic from base64. May throw an exception. */