Files
sanctuary-beta/tools/generate-fut-models.py
2026-09-16 11:41:27 +02:00

16 lines
1.0 KiB
Python

"""Apply the original 48px cask artwork using UV thirds, without resampling."""
import json
from pathlib import Path
root = Path(__file__).resolve().parents[1] / 'mods/sanctuary/src/main/resources/assets/sanctuary/models/block/fut'
root.mkdir(parents=True, exist_ok=True)
for y in range(3):
for z in range(3):
for x in range(3):
faces = {}
for direction, u, v in [('north',2-x,2-y),('south',x,2-y),('east',2-z,2-y),('west',z,2-y),('up',x,z),('down',x,2-z)]:
texture = 'top' if direction == 'up' else 'bottom' if direction == 'down' else 'side'
faces[direction] = {'texture':'#'+texture, 'cullface':direction, 'uv':[u*16/3,v*16/3,(u+1)*16/3,(v+1)*16/3]}
model = {'textures':{n:'sanctuary:block/fut/'+n for n in ('bottom','side','top')} | {'particle':'sanctuary:block/fut/side'},
'elements':[{'from':[0,0,0],'to':[16,16,16],'faces':faces}]}
(root / f'{x}_{y}_{z}.json').write_text(json.dumps(model,indent=2)+'\n')