From 11d5ac1e07d5de6146ee3260146237625b5dbc18 Mon Sep 17 00:00:00 2001 From: LexManos Date: Tue, 19 Mar 2013 13:48:18 -0700 Subject: [PATCH] Fix NPE with CoreMods who do not have the new MCVersion annotation. --- .../mods/fml/relauncher/RelaunchLibraryManager.java | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/fml/common/cpw/mods/fml/relauncher/RelaunchLibraryManager.java b/fml/common/cpw/mods/fml/relauncher/RelaunchLibraryManager.java index 58e8017a1..af870fa8f 100644 --- a/fml/common/cpw/mods/fml/relauncher/RelaunchLibraryManager.java +++ b/fml/common/cpw/mods/fml/relauncher/RelaunchLibraryManager.java @@ -408,7 +408,15 @@ public class RelaunchLibraryManager classLoader.addTransformerExclusion(fmlCorePlugin); Class coreModClass = Class.forName(fmlCorePlugin, true, classLoader); MCVersion requiredMCVersion = coreModClass.getAnnotation(IFMLLoadingPlugin.MCVersion.class); - String version = requiredMCVersion.value(); + String version = ""; + if (requiredMCVersion == null) + { + FMLRelaunchLog.log(Level.WARNING, "The coremod %s does not have a MCVersion annotation, it may cause issues with this version of Minecraft", fmlCorePlugin); + } + else + { + version = requiredMCVersion.value(); + } if (!"".equals(version) && !FMLInjectionData.mccversion.equals(version)) { FMLRelaunchLog.log(Level.SEVERE, "The coremod %s is requesting minecraft version %s and minecraft is %s. It will be ignored.", fmlCorePlugin, version, FMLInjectionData.mccversion);