From 03d3e852fcf308e2c9aff94f36836cc8d372695e Mon Sep 17 00:00:00 2001 From: Andrew Chin Date: Thu, 15 Mar 2012 21:52:22 -0400 Subject: [PATCH] Backed out my level.dat reread code --- overviewer_core/world.py | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/overviewer_core/world.py b/overviewer_core/world.py index 7323a4a..0a5864e 100644 --- a/overviewer_core/world.py +++ b/overviewer_core/world.py @@ -97,14 +97,9 @@ class World(object): # it seems that reading a level.dat file is unstable, particularly with respect # to the spawnX,Y,Z variables. So we'll try a few times to get a good reading # empirically, it seems that 0,50,0 is a "bad" reading - retrycount = 0 - while (data['SpawnX'] == 0 and data['SpawnY'] == 50 and data['SpawnZ'] ==0 ): - logging.debug("bad level read, retrying") - time.sleep(random.random()) - data = nbt.load(os.path.join(self.worlddir, "level.dat"))[1]['Data'] - retrycount += 1 - if retrycount > 10: - raise Exception("Failed to correctly read level.dat") + # update: 0,50,0 is the default spawn, and may be valid is some cases + # more info is needed + data = nbt.load(os.path.join(self.worlddir, "level.dat"))[1]['Data'] # Hard-code this to only work with format version 19133, "Anvil"