barneygale / quarry

Python library that implements the Minecraft network protocol and data types
Other
532 stars 74 forks source link

fix bug where some chunks get skipped #110

Closed jarekt closed 3 years ago

jarekt commented 3 years ago

When going through certain chunks the BufferUnderrun() exception is raised without any way of prevention (there is no way to manually set the length arg of read() in nbt.py). This simple change fixes that and all chunks get processed normally.

Traceback here:

Traceback (most recent call last):
  File "...\mc-world-miner-master\mine_region_file.py", line 51, in main
    chunk = region.load_chunk(cx, cz)
  File "...\AppData\Local\Programs\Python\Python39\lib\site-packages\quarry\types\nbt.py", line 351, in load_chunk
    chunk = buff.read(buff.unpack('IB')[0])
  File "...\AppData\Local\Programs\Python\Python39\lib\site-packages\quarry\types\buffer\v1_7.py", line 75, in read
    raise BufferUnderrun()

the mc-world-miner in case that plays any role

dries007 commented 3 years ago

I reverted this merge as it breaks more than it fixes. Please fix it :)