Check to ensure level.dat has been updated
Error out if level.dat has not been updated. Also, cleaned up some debugging print statements
This commit is contained in:
2
chunk.py
2
chunk.py
@@ -141,7 +141,7 @@ def find_oldimage(chunkXY, cached, cave):
|
|||||||
if key in cached[cachename]:
|
if key in cached[cachename]:
|
||||||
oldimg_path = cached[cachename][key]
|
oldimg_path = cached[cachename][key]
|
||||||
_, oldimg = os.path.split(oldimg_path)
|
_, oldimg = os.path.split(oldimg_path)
|
||||||
logging.debug("Found cached image {0}".format(oldimg))
|
#logging.debug("Found cached image {0}".format(oldimg))
|
||||||
return oldimg, oldimg_path
|
return oldimg, oldimg_path
|
||||||
|
|
||||||
def check_cache(world, chunkXY, oldimg):
|
def check_cache(world, chunkXY, oldimg):
|
||||||
|
|||||||
12
world.py
12
world.py
@@ -120,9 +120,9 @@ class WorldRenderer(object):
|
|||||||
# if mcregion, error out early until we can add support
|
# if mcregion, error out early until we can add support
|
||||||
data = nbt.load(os.path.join(self.worlddir, "level.dat"))[1]['Data']
|
data = nbt.load(os.path.join(self.worlddir, "level.dat"))[1]['Data']
|
||||||
#print data
|
#print data
|
||||||
if 'version' in data and data['version'] == 19132:
|
if not ('version' in data and data['version'] == 19132):
|
||||||
logging.error("Sorry, Minecraft-Overviewer doesn't yet know how to read McRegion chunks")
|
logging.error("Sorry, This version of Minecraft-Overviewer only works with the new McRegion chunk format")
|
||||||
#sys.exit(1)
|
sys.exit(1)
|
||||||
|
|
||||||
if self.useBiomeData:
|
if self.useBiomeData:
|
||||||
textures.prepareBiomeData(worlddir)
|
textures.prepareBiomeData(worlddir)
|
||||||
@@ -292,16 +292,12 @@ class WorldRenderer(object):
|
|||||||
all_chunks = []
|
all_chunks = []
|
||||||
|
|
||||||
regions = self._find_regionfiles()
|
regions = self._find_regionfiles()
|
||||||
print "found %d regions" % len(regions)
|
logging.debug("Found %d regions",len(regions))
|
||||||
for region in regions:
|
for region in regions:
|
||||||
print "region %d, %d --> %s" % region
|
|
||||||
these_chunks = list(itertools.product(
|
these_chunks = list(itertools.product(
|
||||||
range(region[0]*32,region[0]*32 + 32),
|
range(region[0]*32,region[0]*32 + 32),
|
||||||
range(region[1]*32,region[1]*32 + 32)
|
range(region[1]*32,region[1]*32 + 32)
|
||||||
))
|
))
|
||||||
print "region %d,%d will go from:"
|
|
||||||
print " %r" % range(region[0]*32,region[0]*32 + 32)
|
|
||||||
print " %r" % range(region[1]*32,region[1]*32 + 32)
|
|
||||||
these_chunks = map(lambda x: (x[0], x[1], region[2]), these_chunks)
|
these_chunks = map(lambda x: (x[0], x[1], region[2]), these_chunks)
|
||||||
assert(len(these_chunks) == 1024)
|
assert(len(these_chunks) == 1024)
|
||||||
all_chunks += these_chunks
|
all_chunks += these_chunks
|
||||||
|
|||||||
Reference in New Issue
Block a user