0

biome: fix crash on depth increased worlds

Unsurprisingly, my code was at fault.

Does not yet render any of the new data. Just fixes parsing it.

Closes #1902.
This commit is contained in:
Nicolas F
2021-06-11 20:00:01 +02:00
parent f2afeda287
commit 9081f78ba6

View File

@@ -14,6 +14,9 @@
# You should have received a copy of the GNU General Public License along
# with the Overviewer. If not, see <http://www.gnu.org/licenses/>.
class BiomeException(Exception):
def __init__(self, msg):
self.msg = msg
def reshape_biome_data(biome_array):
biome_len = len(biome_array)
@@ -28,3 +31,7 @@ def reshape_biome_data(biome_array):
# but they appear to either be wrong or have explained it with the eloquence of a
# caveman.
return biome_array.reshape((4, 64, 4))
elif biome_len == 1536:
return biome_array.reshape((4, 96, 4))
else:
raise BiomeException(f"Can't reshape a biome of length {biome_len}")