-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathgen_resources.py
More file actions
23 lines (19 loc) · 1.03 KB
/
Copy pathgen_resources.py
File metadata and controls
23 lines (19 loc) · 1.03 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
import os
import sys
import shutil
from PIL import Image
from resgen.extract_resources import extract_resources, get_default_minecraft_dir
from resgen.apply_mask import apply_mask
from resgen.convert_sounds import convert_ogg_to_aiff
def get_script_path():
return os.path.dirname(os.path.realpath(sys.argv[0]))
def fix_rgba_image(img_file):
Image.open(img_file).convert("RGBA").save(img_file)
if __name__ == "__main__":
os.chdir(get_script_path())
extract_resources(get_default_minecraft_dir(), "resourcelist.txt", "resources")
shutil.copytree("resgen/edited", "resources", dirs_exist_ok=True)
apply_mask("resources/textures/terrain.png", "resources/textures/terrain_masked.png", "resources/textures/terrain_mask.png", "resources/textures/terrain.png")
apply_mask("resources/textures/gui/icons.png", "resources/textures/gui/icons_masked.png", "resources/textures/gui/icons_mask.png", "resources/textures/gui/icons.png")
fix_rgba_image("resources/textures/particles.png")
convert_ogg_to_aiff("resources/newsound")