Add block color generation tools for Minecraft 1.13

This commit is contained in:
Matthias Schiffer 2018-07-22 16:54:00 +02:00
parent f3d65febf3
commit 73a072c2ca
Signed by: neocturne
GPG key ID: 16EF3F64CB201D9C
3 changed files with 1392 additions and 0 deletions

26
resource/generate.py Executable file
View file

@ -0,0 +1,26 @@
#!/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, {%u, %u, %u}}},' % (
name,
['false', 'true'][info['opaque']],
['false', 'true'][info['green']],
['false', 'true'][info['blue']],
info['color']['r'],
info['color']['g'],
info['color']['b'],
), file=f)