general mindustry schematic tools
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
import * as fs from 'fs'
import {
  Schematic
} from 'mindustry-schematic-parser'

const base64 = process.argv.slice(2)[0]
const schematic = Schematic.decode(base64)
console.log(schematic.name)

// save a preview of the schematic
schematic
  .render({
    background: false // disable background
  })
  .then(nodeCanvas => nodeCanvas.toBuffer())
  .then(buffer => fs.writeFileSync('/tmp/mindustry_schematics/image.png', buffer))