fixed crash when spawn point does not have an associated region file (closes issue #399)
This commit is contained in:
6
world.py
6
world.py
@@ -209,7 +209,9 @@ class World(object):
|
|||||||
## The filename of this chunk
|
## The filename of this chunk
|
||||||
chunkFile = self.get_region_path(chunkX, chunkY)
|
chunkFile = self.get_region_path(chunkX, chunkY)
|
||||||
|
|
||||||
data=nbt.load_from_region(chunkFile, chunkX, chunkY)[1]
|
if chunkFile is not None:
|
||||||
|
data = nbt.load_from_region(chunkFile, chunkX, chunkY)[1]
|
||||||
|
if data is not None:
|
||||||
level = data['Level']
|
level = data['Level']
|
||||||
blockArray = numpy.frombuffer(level['Blocks'], dtype=numpy.uint8).reshape((16,16,128))
|
blockArray = numpy.frombuffer(level['Blocks'], dtype=numpy.uint8).reshape((16,16,128))
|
||||||
|
|
||||||
@@ -224,7 +226,7 @@ class World(object):
|
|||||||
break
|
break
|
||||||
|
|
||||||
self.POI.append( dict(x=spawnX, y=spawnY, z=spawnZ,
|
self.POI.append( dict(x=spawnX, y=spawnY, z=spawnZ,
|
||||||
msg="Spawn", type="spawn", chunk=(inChunkX,inChunkZ)))
|
msg="Spawn", type="spawn", chunk=(chunkX, chunkY)))
|
||||||
self.spawn = (spawnX, spawnY, spawnZ)
|
self.spawn = (spawnX, spawnY, spawnZ)
|
||||||
|
|
||||||
def go(self, procs):
|
def go(self, procs):
|
||||||
|
|||||||
Reference in New Issue
Block a user