world: skip zero-size region files
Minecraft 1.16.1 loves writing these in singleplayer, and they cause a whole bunch of corruption warnings if we don't handle them in a special way like this.
This commit is contained in:
@@ -288,7 +288,10 @@ class RegionSet(object):
|
||||
|
||||
for x, y, regionfile in self._iterate_regionfiles():
|
||||
# regionfile is a pathname
|
||||
self.regionfiles[(x,y)] = (regionfile, os.path.getmtime(regionfile))
|
||||
if os.path.getsize(regionfile) != 0:
|
||||
self.regionfiles[(x,y)] = (regionfile, os.path.getmtime(regionfile))
|
||||
else:
|
||||
logging.debug("Skipping zero-size region file {}".format(regionfile))
|
||||
|
||||
self.empty_chunk = [None,None]
|
||||
logging.debug("Done scanning regions")
|
||||
|
||||
Reference in New Issue
Block a user