Change _iterate_regionfiles to use glob instead of os.walk. The function gets simpler in this way
With this you can fool overviewer to render the nether just poiting the "DIM-1" instead the world dir. (and you also need to copy the level.dat to the DIM-1 directory, because nether has not spawn)
This commit is contained in:
11
world.py
11
world.py
@@ -16,6 +16,7 @@
|
|||||||
import functools
|
import functools
|
||||||
import os
|
import os
|
||||||
import os.path
|
import os.path
|
||||||
|
from glob import glob
|
||||||
import multiprocessing
|
import multiprocessing
|
||||||
import Queue
|
import Queue
|
||||||
import sys
|
import sys
|
||||||
@@ -287,12 +288,10 @@ class World(object):
|
|||||||
p = f.split(".")
|
p = f.split(".")
|
||||||
yield (int(p[1]), int(p[2]), join(self.worlddir, 'region', f))
|
yield (int(p[1]), int(p[2]), join(self.worlddir, 'region', f))
|
||||||
else:
|
else:
|
||||||
for dirpath, dirnames, filenames in os.walk(os.path.join(self.worlddir, 'region')):
|
for path in glob(os.path.join(self.worlddir, 'region') + "/r.*.*.mcr"):
|
||||||
if not dirnames and filenames and "DIM-1" not in dirpath:
|
dirpath, f = os.path.split(path)
|
||||||
for f in filenames:
|
p = f.split(".")
|
||||||
if f.startswith("r.") and f.endswith(".mcr"):
|
yield (int(p[1]), int(p[2]), join(dirpath, f))
|
||||||
p = f.split(".")
|
|
||||||
yield (int(p[1]), int(p[2]), join(dirpath, f))
|
|
||||||
|
|
||||||
def get_save_dir():
|
def get_save_dir():
|
||||||
"""Returns the path to the local saves directory
|
"""Returns the path to the local saves directory
|
||||||
|
|||||||
Reference in New Issue
Block a user