0

Fixed default texture loading

Now accounts for the versions directory, which is maintained by the new
launcher
This commit is contained in:
Andrew Chin
2013-07-02 19:05:17 -04:00
parent 00e4528ddc
commit 57ab387b29
2 changed files with 13 additions and 5 deletions

View File

@@ -148,12 +148,12 @@ def main():
logging.info("Looking for a few common texture files...")
try:
f = tex.find_file("textures/blocks/stone.png", verbose=True)
f = tex.find_file("textures/blocks/tallgrass.png", verbose=True)
f = tex.find_file("textures/blocks/oreDiamond.png", verbose=True)
f = tex.find_file("textures/blocks/wood.png", verbose=True)
f = tex.find_file("assets/minecraft/textures/blocks/sandstone_top.png", verbose=True)
f = tex.find_file("assets/minecraft/textures/blocks/grass_top.png", verbose=True)
f = tex.find_file("assets/minecraft/textures/blocks/diamond_ore.png", verbose=True)
f = tex.find_file("assets/minecraft/textures/blocks/planks_oak.png", verbose=True)
except IOError:
logging.error("Could not find the file stone.png")
logging.error("Could not find any texture files.")
return 1
return 0

View File

@@ -25,6 +25,7 @@ import numpy
from PIL import Image, ImageEnhance, ImageOps, ImageDraw
import logging
import functools
import glob
import util
from c_overviewer import alpha_over
@@ -184,9 +185,16 @@ class Textures(object):
# Find minecraft.jar.
jarpaths = []
if "APPDATA" in os.environ:
jarpaths += sorted(glob.glob(os.path.join(os.environ['APPDATA'], ".minecraft", "versions", "*.*", "*.jar")),
reverse=True)
jarpaths.append( os.path.join(os.environ['APPDATA'], ".minecraft",
"bin", "minecraft.jar"))
if "HOME" in os.environ:
jarpaths += sorted(glob.glob(os.path.join(os.environ['HOME'], ".minecraft", "versions", "*.*", "*.jar")),
reverse=True)
jarpaths += sorted(glob.glob(os.path.join(os.environ['HOME'], "Library", "Application Support", "minecraft",
"versions", "*.*", "*.jar")),
reverse=True)
jarpaths.append(os.path.join(os.environ['HOME'], "Library",
"Application Support", "minecraft","bin","minecraft.jar"))
jarpaths.append(os.path.join(os.environ['HOME'], ".minecraft", "bin",