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:
@@ -14,6 +14,9 @@
|
|||||||
# You should have received a copy of the GNU General Public License along
|
# You should have received a copy of the GNU General Public License along
|
||||||
# with the Overviewer. If not, see <http://www.gnu.org/licenses/>.
|
# 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):
|
def reshape_biome_data(biome_array):
|
||||||
biome_len = len(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
|
# but they appear to either be wrong or have explained it with the eloquence of a
|
||||||
# caveman.
|
# caveman.
|
||||||
return biome_array.reshape((4, 64, 4))
|
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}")
|
||||||
|
|||||||
Reference in New Issue
Block a user