Fix vanilla bug with GLFW init error display - actually the error, not the memory address containing the message

Load natives from the environment var, not hardcoding.
This commit is contained in:
cpw 2018-09-10 20:31:51 -04:00
parent bec9214d0c
commit f72a7e02e3
3 changed files with 22 additions and 4 deletions

View File

@ -62,6 +62,7 @@ project(':forge') {
}
}
repositories {
mavenLocal()
mavenCentral()
}
patcher {
@ -115,11 +116,11 @@ project(':forge') {
options.failOnError = false
options.forkOptions.with {
executable = 'java'
jvmArgs = ['-classpath', project.configurations.ecj.asPath, 'org.eclipse.jdt.internal.compiler.batch.Main', '-nowarn']
jvmArgs = ['-classpath', project.configurations.ecj.asPath, 'org.eclipse.jdt.internal.compiler.batch.Main', '-nowarn', '-proceedOnError', '-preserveAllLocals', '-parameters']
}
}
task runclient(type: JavaExec) {
task runclient(type: JavaExec, dependsOn: [":forge:downloadAssets", ":forge:extractNatives"]) {
doFirst {
mkdir 'runclient'
}
@ -132,7 +133,15 @@ project(':forge') {
// jvmArgs = ['-verbose:class']
classpath sourceSets.main.runtimeClasspath
main 'net.minecraftforge.fml.LaunchTesting'
environment target:'fmldevclient'
systemProperties = [
"org.lwjgl.util.Debug": "true",
"org.lwjgl.util.DebugLoader": "true"
]
environment += [
target:'fmldevclient',
assetDirectory: file("${gradle.getGradleUserHomeDir()}/caches/forge_gradle/assets/"),
nativesDirectory: extractNatives.output
]
workingDir 'runclient'
}

View File

@ -24,6 +24,15 @@
if (this.gameSettings.fullScreen && !this.field_195558_d.func_198113_j()) {
this.field_195558_d.func_198077_g();
}
@@ -485,7 +488,7 @@
});
List<String> list = Lists.<String>newArrayList();
GLFWErrorCallback glfwerrorcallback = GLFW.glfwSetErrorCallback((p_211100_1_, p_211100_2_) -> {
- list.add(String.format("GLFW error during init: [0x%X]%s", p_211100_1_, p_211100_2_));
+ list.add(String.format("GLFW error during init: [0x%X] %s", p_211100_1_, GLFWErrorCallback.getDescription(p_211100_2_)));
});
if (!GLFW.glfwInit()) {
throw new IllegalStateException("Failed to initialize GLFW, errors: " + Joiner.on(",").join(list));
@@ -1392,6 +1395,7 @@
NetworkManager networkmanager = NetworkManager.provideLocalClient(socketaddress);
networkmanager.setNetHandler(new NetHandlerLoginClient(networkmanager, this, (GuiScreen)null, (p_209507_0_) -> {

View File

@ -70,7 +70,7 @@ public class LaunchTesting
private static void hackNatives()
{
String paths = System.getProperty("java.library.path");
String nativesDir = "/home/cpw/.gradle/caches/minecraft/net/minecraft/natives/1.12.2"; //TODO Not hardcode this, FG setups us a natives folder. And sets it in the eclipse run configs.
String nativesDir = System.getenv().get("nativesDirectory");
if (Strings.isNullOrEmpty(paths))
paths = nativesDir;