overviewer.py no longer loops forever if it can't find terrain.png
There's also a more helpful error if any texture can't be found. Closes #475.
This commit is contained in:
@@ -30,7 +30,7 @@ import multiprocessing
|
||||
import time
|
||||
import logging
|
||||
import platform
|
||||
from overviewer_core import util
|
||||
from overviewer_core import util, textures
|
||||
|
||||
logging.basicConfig(level=logging.INFO,format="%(asctime)s [%(levelname)s] %(message)s")
|
||||
|
||||
@@ -147,7 +147,6 @@ def main():
|
||||
if options.check_terrain:
|
||||
import hashlib
|
||||
from overviewer_core.textures import _find_file
|
||||
from overviewer_core import textures
|
||||
if options.textures_path:
|
||||
textures._find_file_local_path = options.textures_path
|
||||
|
||||
@@ -276,6 +275,13 @@ dir but you forgot to put quotes around the directory, since it contains spaces.
|
||||
if not useBiomeData:
|
||||
logging.info("Notice: Not using biome data for tinting")
|
||||
|
||||
# make sure that the textures can be found
|
||||
try:
|
||||
textures.generate()
|
||||
except IOError, e:
|
||||
logging.error(str(e))
|
||||
sys.exit(1)
|
||||
|
||||
# First do world-level preprocessing
|
||||
w = world.World(worlddir, destdir, useBiomeData=useBiomeData, regionlist=regionlist, north_direction=north_direction)
|
||||
if north_direction == 'auto':
|
||||
|
||||
@@ -97,7 +97,7 @@ def _find_file(filename, mode="rb", verbose=False):
|
||||
except (KeyError, IOError):
|
||||
pass
|
||||
|
||||
raise IOError("Could not find the file {0}. Is Minecraft installed? If so, I couldn't find the minecraft.jar file.".format(filename))
|
||||
raise IOError("Could not find the file `{0}'. You can either place it in the same place as overviewer.py, use --textures-path, or install the Minecraft client.".format(filename))
|
||||
|
||||
def _load_image(filename):
|
||||
"""Returns an image object"""
|
||||
|
||||
Reference in New Issue
Block a user