SchematicaMapping and MCEdit2 BlockIDs code here: https://github.com/maruohon/litematica/blob/master/src/main/java/fi/dy/masa/litematica/schematic/SchematicaSchematic.java#L465 (though, that's GPL, which is incompatible, so maybe find another source, or just figure out the format)