mirror of
https://github.com/neocturne/MinedMap.git
synced 2025-07-03 22:29:07 +02:00
Add block color generation tools for Minecraft 1.13
This commit is contained in:
parent
f3d65febf3
commit
73a072c2ca
3 changed files with 1392 additions and 0 deletions
26
resource/generate.py
Executable file
26
resource/generate.py
Executable 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)
|
Loading…
Add table
Add a link
Reference in a new issue