From 80cc71325e4a10c6eb8d554dfb5d1b440f2b3e19 Mon Sep 17 00:00:00 2001 From: rymate1234 Date: Mon, 12 Mar 2018 23:43:07 +0000 Subject: [PATCH 1/2] Throw an error if the overviewer is running on a world saved on versions of Minecraft newer than snapshot 17w47a --- overviewer_core/world.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/overviewer_core/world.py b/overviewer_core/world.py index 49ac976..4009c01 100644 --- a/overviewer_core/world.py +++ b/overviewer_core/world.py @@ -111,6 +111,17 @@ class World(object): logging.critical("Sorry, This version of Minecraft-Overviewer only works with the 'Anvil' chunk format") raise ValueError("World at %s is not compatible with Overviewer" % self.worlddir) + + # Check for versions of minecraft after the 17w47a changes + if 'Version' in data: + version = int(data['Version']["Id"]) + # version Id of 17w47a + if version >= 1452: + logging.critical("Sorry, This version of Minecraft-Overviewer only works with versions of Minecraft 1.12 and under") + logging.critical("This is due to a change in the map chunk format that happened in snapshot 17w47a") + raise ValueError("World at %s is not compatible with Overviewer" % self.worlddir) + + # This isn't much data, around 15 keys and values for vanilla worlds. self.leveldat = data From c6922386a5c1fa74a016385e7bb4d55f4e5a1ae5 Mon Sep 17 00:00:00 2001 From: rymate1234 Date: Mon, 12 Mar 2018 23:47:50 +0000 Subject: [PATCH 2/2] Use sys.exit(1) to exit rather than throwing a ValueError --- overviewer_core/world.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/overviewer_core/world.py b/overviewer_core/world.py index 4009c01..50ef898 100644 --- a/overviewer_core/world.py +++ b/overviewer_core/world.py @@ -21,6 +21,7 @@ import time import random import re import locale +import sys import numpy @@ -115,11 +116,10 @@ class World(object): # Check for versions of minecraft after the 17w47a changes if 'Version' in data: version = int(data['Version']["Id"]) - # version Id of 17w47a if version >= 1452: logging.critical("Sorry, This version of Minecraft-Overviewer only works with versions of Minecraft 1.12 and under") logging.critical("This is due to a change in the map chunk format that happened in snapshot 17w47a") - raise ValueError("World at %s is not compatible with Overviewer" % self.worlddir) + sys.exit(1) # This isn't much data, around 15 keys and values for vanilla worlds.