From 0072eae3f0ab8cbc5162bd25ab821aec6e563665 Mon Sep 17 00:00:00 2001 From: Nicolas F Date: Sun, 17 Mar 2019 18:13:26 +0100 Subject: [PATCH] world: fix reading old biomes Some older maps store biomes differently, and we should use this as a bytes object, not a str object. --- overviewer_core/world.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/overviewer_core/world.py b/overviewer_core/world.py index 77db363..7f180b6 100644 --- a/overviewer_core/world.py +++ b/overviewer_core/world.py @@ -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)