diff --git a/src/main/scala/li/cil/oc/common/Proxy.scala b/src/main/scala/li/cil/oc/common/Proxy.scala index 188b3308f..a7a6b1e89 100644 --- a/src/main/scala/li/cil/oc/common/Proxy.scala +++ b/src/main/scala/li/cil/oc/common/Proxy.scala @@ -1,6 +1,7 @@ package li.cil.oc.common import com.google.common.base.Strings +import cpw.mods.fml.common.FMLLog import cpw.mods.fml.common.event._ import cpw.mods.fml.common.network.NetworkRegistry import cpw.mods.fml.common.registry.EntityRegistry @@ -23,6 +24,8 @@ import scala.collection.convert.WrapAsScala._ class Proxy { def preInit(e: FMLPreInitializationEvent) { + checkForBrokenJavaVersion() + Settings.load(e.getSuggestedConfigurationFile) OpenComputers.log.info("Initializing blocks and items.") @@ -141,4 +144,18 @@ class Proxy { } } } + + // OK, seriously now, I've gotten one too many bug reports because of this Java version being broken. + + private final val BrokenJavaVersions = Set("1.6.0_65, Apple Inc.") + + def isBrokenJavaVersion = { + val javaVersion = System.getProperty("java.version") + ", " + System.getProperty("java.vendor") + BrokenJavaVersions.contains(javaVersion) + } + + def checkForBrokenJavaVersion() = if (isBrokenJavaVersion) { + FMLLog.bigWarning("You're using a broken Java version! Please update now, or remove OpenComputers. DO NOT REPORT THIS! UPDATE YOUR JAVA!") + throw new Exception("You're using a broken Java version! Please update now, or remove OpenComputers. DO NOT REPORT THIS! UPDATE YOUR JAVA!") + } }