That's it, I've had enough.

This commit is contained in:
Florian Nücke 2015-05-30 22:34:15 +02:00
parent 9afe70778b
commit dc80da8d39

View File

@ -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!")
}
}