0

Fix for reading worlds from local dir

This commit is contained in:
Andrew Chin
2019-06-21 23:35:33 -04:00
parent 9a52a02f13
commit c78b17f6a7

View File

@@ -1721,11 +1721,11 @@ def get_worlds():
world_path = os.path.join(".", dir) world_path = os.path.join(".", dir)
try: try:
info = nbt.load(world_dat)[1] info = nbt.load(world_dat)[1]
info['Data']['path'] = world_path.decode(loc) info['Data']['path'] = world_path
if 'LevelName' in info['Data'].keys(): if 'LevelName' in info['Data'].keys():
ret[info['Data']['LevelName']] = info['Data'] ret[info['Data']['LevelName']] = info['Data']
except nbt.CorruptNBTError: except nbt.CorruptNBTError:
ret[os.path.basename(world_path).decode(loc) + " (corrupt)"] = {'path': world_path.decode(loc), ret[os.path.basename(world_path) + " (corrupt)"] = {'path': world_path,
'LastPlayed': 0, 'LastPlayed': 0,
'Time': 0, 'Time': 0,
'IsCorrupt': True} 'IsCorrupt': True}