Skip to content

Commit 4e51b21

Browse files
committed
world: fix pre-21w43a workaround being applied when sections is missing
Sometimes, chunks don't have a sections key, but aren't pre-21w43a. Fix this check to use DataVersion to determine whether it should be applied. Hopefully fixes #2010.
1 parent 2de7248 commit 4e51b21

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

overviewer_core/world.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1707,13 +1707,13 @@ def get_chunk(self, x, z):
17071707

17081708
chunk_data = data[1]
17091709

1710-
if not 'sections' in chunk_data:
1710+
if chunk_data.get('DataVersion', 0) <= 2840 and 'Level' in chunk_data:
17111711
# This world was generated pre 21w43a and thus most chunk data is contained
17121712
# in the "Level" key
17131713
chunk_data = chunk_data['Level']
17141714
else:
1715-
# This world was generated post 21w43a
1716-
chunk_data['Sections'] = chunk_data['sections']
1715+
# This world was (probably) generated post 21w43a
1716+
chunk_data['Sections'] = chunk_data.get('sections', [])
17171717

17181718
longarray_unpacker = self._packed_longarray_to_shorts
17191719
if data[1].get('DataVersion', 0) >= 2529:

0 commit comments

Comments
 (0)