From 9081f78ba680ddd67389f8d44361bf7313ed9c9f Mon Sep 17 00:00:00 2001 From: Nicolas F Date: Fri, 11 Jun 2021 20:00:01 +0200 Subject: [PATCH] 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. --- overviewer_core/biome.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/overviewer_core/biome.py b/overviewer_core/biome.py index 9910165..61904f1 100644 --- a/overviewer_core/biome.py +++ b/overviewer_core/biome.py @@ -14,6 +14,9 @@ # You should have received a copy of the GNU General Public License along # with the Overviewer. If not, see . +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}")