diff --git a/fml/commands.patch b/fml/commands.patch index e7114ea3af..8cd5cb02d5 100644 --- a/fml/commands.patch +++ b/fml/commands.patch @@ -178,4 +178,4 @@ +def commands_sanity_check(): + print 'Commands patch applied successfully' -+ \ No newline at end of file ++ diff --git a/fml/common/cpw/mods/fml/common/Loader.java b/fml/common/cpw/mods/fml/common/Loader.java index e232d26ff1..9fc0e27ab6 100644 --- a/fml/common/cpw/mods/fml/common/Loader.java +++ b/fml/common/cpw/mods/fml/common/Loader.java @@ -32,6 +32,7 @@ import java.util.logging.Level; import java.util.regex.Matcher; import net.minecraft.server.MinecraftServer; +import net.minecraft.src.CallableMinecraftVersion; import com.google.common.base.CharMatcher; import com.google.common.base.Function; @@ -160,6 +161,12 @@ public class Loader private Loader() { modClassLoader = new ModClassLoader(getClass().getClassLoader()); + String actualMCVersion = new CallableMinecraftVersion(null).func_71493_a(); + if (!mccversion.equals(actualMCVersion)) + { + FMLLog.severe("This version of FML is built for Minecraft %s, we have detected Minecraft %s in your minecraft jar file", mccversion, actualMCVersion); + throw new LoaderException(); + } } /** diff --git a/fml/common/cpw/mods/fml/relauncher/RelaunchLibraryManager.java b/fml/common/cpw/mods/fml/relauncher/RelaunchLibraryManager.java index 295bfabac2..cddfe66f36 100644 --- a/fml/common/cpw/mods/fml/relauncher/RelaunchLibraryManager.java +++ b/fml/common/cpw/mods/fml/relauncher/RelaunchLibraryManager.java @@ -248,13 +248,15 @@ public class RelaunchLibraryManager Class loaderClazz = Class.forName("cpw.mods.fml.common.Loader", true, actualClassLoader); Method m = loaderClazz.getMethod("injectData", Object[].class); m.invoke(null, (Object)FMLInjectionData.data()); + m = loaderClazz.getMethod("instance"); + m.invoke(null); downloadMonitor.updateProgressString("Minecraft validated, launching..."); downloadBuffer = null; } catch (Exception e) { // Load in the Loader, make sure he's ready to roll - this will initialize most of the rest of minecraft here - System.out.println("RelaunchLibraryManager.handleLaunch"); + System.out.println("A CRITICAL PROBLEM OCCURED INITIALIZING MINECRAFT - LIKELY YOU HAVE AN INCORRECT VERSION FOR THIS FML"); e.printStackTrace(); throw new RuntimeException(e); } diff --git a/fml/common/fml_at.cfg b/fml/common/fml_at.cfg index 062c47038f..f90e516166 100644 --- a/fml/common/fml_at.cfg +++ b/fml/common/fml_at.cfg @@ -193,3 +193,6 @@ protected lh.a(Luo;III)Z protected lh.f()Z # CallableMinecraftVersion - sanity check the MC version public b +public b.(La;)V # constructor +# RenderEngine +public ave.k # texturePack \ No newline at end of file