From a3e4812ca906146408171b34e3c313fcb5e7ee69 Mon Sep 17 00:00:00 2001 From: Nicolas F Date: Thu, 25 Jun 2020 23:15:48 +0200 Subject: [PATCH] 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. --- overviewer_core/world.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/overviewer_core/world.py b/overviewer_core/world.py index cfe9505..6551dbd 100644 --- a/overviewer_core/world.py +++ b/overviewer_core/world.py @@ -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")