From 06e874eca47d2cd258c303723ffb774b98f0cfa9 Mon Sep 17 00:00:00 2001 From: David Vierra Date: Sun, 27 Mar 2016 04:27:15 -1000 Subject: [PATCH] Fall back to first version found when selected version is not found. --- src/mcedit2/util/minecraftinstall.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/mcedit2/util/minecraftinstall.py b/src/mcedit2/util/minecraftinstall.py index 768e4af..c3532c5 100644 --- a/src/mcedit2/util/minecraftinstall.py +++ b/src/mcedit2/util/minecraftinstall.py @@ -309,7 +309,12 @@ class MCInstall(object): loader.addZipFile(self.getResourcePackPath(resourcePack)) except Exception as e: log.warn("Failed to load resource pack: %r\nPack: %s", e, resourcePack) - loader.addZipFile(self.getVersionJarPath(version)) + path = self.getVersionJarPath(version) + if not os.path.exists(path): + if len(self.versions): + log.warn("Version %s not found, falling back to first version found", version) + path = self.getVersionJarPath(self.versions[0]) + loader.addZipFile(path) major, minor, rev = splitVersion(version) # Need v1.8 for block models