mirror of
https://github.com/neocturne/MinedMap.git
synced 2025-03-04 17:23:33 +01:00
27 lines
574 B
Python
Executable file
27 lines
574 B
Python
Executable file
#!/usr/bin/env python3
|
|
|
|
import json
|
|
import os
|
|
import sys
|
|
|
|
|
|
if len(sys.argv) != 3:
|
|
sys.exit('Usage: extract.py <colors.json> <BlockType.inc>')
|
|
|
|
with open(sys.argv[1]) as f:
|
|
colors = json.load(f)
|
|
|
|
output = {}
|
|
|
|
with open(sys.argv[2], 'w') as f:
|
|
for name, info in colors.items():
|
|
print('{"%s", {%s, %s, %s, %s, {%u, %u, %u}}},' % (
|
|
name,
|
|
['false', 'true'][info['opaque']],
|
|
['false', 'true'][info['grass']],
|
|
['false', 'true'][info['foliage']],
|
|
['false', 'true'][info['blue']],
|
|
info['color']['r'],
|
|
info['color']['g'],
|
|
info['color']['b'],
|
|
), file=f)
|