Terrafier/scripts/download_colormap_pngs.py
loki5512344 91835402b3 Initial commit: Terrafier v0.1.0
- Core world model (World, Dimension, Tile, Terrain, Platform)
- NBT reader/writer with full tag support
- Anvil region (.mca) format reader with chunk parsing
- Block palette compression and export
- Biome database with Minecraft 1.21 biomes
- CLI commands: new, import, export, info, render
- GUI application with egui (viewport, tools, undo/redo)
- Noise-based heightmap generation and editing operations

License: GPL-3.0-or-later
2026-06-15 19:14:11 +02:00

19 lines
751 B
Python
Executable file

"""Download Minecraft colormap PNG files for embedding."""
import urllib.request
import os
base_url = "https://raw.githubusercontent.com/InventivetalentDev/minecraft-assets/1.21.11/assets/minecraft/textures/colormap"
output_dir = os.path.join(os.path.dirname(__file__), "..", "crates", "biome-db", "data")
files = ["grass.png", "foliage.png", "dry_foliage.png"]
for name in files:
url = f"{base_url}/{name}"
outpath = os.path.join(output_dir, name)
print(f"Downloading {name}...")
req = urllib.request.Request(url, headers={"User-Agent": "Mozilla/5.0"})
resp = urllib.request.urlopen(req, timeout=15)
data = resp.read()
with open(outpath, "wb") as f:
f.write(data)
print(f" {len(data)} bytes -> {outpath}")