From 0004540a57677486c46da02eed66f70e3412b7a5 Mon Sep 17 00:00:00 2001 From: Nicolas F Date: Sun, 28 Apr 2019 13:38:05 +0200 Subject: [PATCH] world: only render fully formed and lit chunks Minecraft notes various stages of fetal development that chunks are in, with the complete ones being "full". Previously, we'd check against a list of states that are not full to skip a chunk, which is obviously not future proof, and broke as Mojang updated their possible range of values for the status field. It's better to just bail if the status is anything other than "full". Additionally, a key called "isLightOn" is in the chunk now. This seemingly determines whether a chunk has been lit. We're also going to check for this, and bail if it's not. In my tests, I have not yet seen a single "full" chunk that does not have "isLightOn" set. Fixes #1558. --- overviewer_core/world.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/overviewer_core/world.py b/overviewer_core/world.py index 9f91efc..d7d1699 100644 --- a/overviewer_core/world.py +++ b/overviewer_core/world.py @@ -1307,8 +1307,10 @@ class RegionSet(object): # Empty is self-explanatory, and liquid_carved and carved seem to correspond # to SkyLight not being calculated, which results in mostly-black chunks, # so we'll just pretend they aren't there. - if chunk_data.get("Status", "") in ("empty", "carved", "liquid_carved", "decorated"): + if chunk_data.get("Status", "") != "full": raise ChunkDoesntExist("Chunk %s,%s doesn't exist" % (x,z)) + if not chunk_data.get("isLightOn", 0): + raise ChunkDoesntExist("Chunk %s,%s isn't lit" % (x,z)) # Turn the Biomes array into a 16x16 numpy arra if 'Biomes' in chunk_data and len(chunk_data['Biomes']) > 0: