0

world: fix reading old biomes

Some older maps store biomes differently, and we should use this as
a bytes object, not a str object.
This commit is contained in:
Nicolas F
2019-03-17 18:13:26 +01:00
parent 137797cd51
commit 0072eae3f0

View File

@@ -1188,10 +1188,10 @@ class RegionSet(object):
if chunk_data.get("Status", "") in ("empty", "carved", "liquid_carved", "decorated"):
raise ChunkDoesntExist("Chunk %s,%s doesn't exist" % (x,z))
# Turn the Biomes array into a 16x16 numpy arra
# Turn the Biomes array into a 16x16 numpy array
if 'Biomes' in chunk_data:
biomes = chunk_data['Biomes']
if isinstance(biomes, str):
if isinstance(biomes, bytes):
biomes = numpy.frombuffer(biomes, dtype=numpy.uint8)
else:
biomes = numpy.asarray(biomes)