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:
parent
bec9214d0c
commit
f72a7e02e3
3 changed files with 22 additions and 4 deletions
15
build.gradle
15
build.gradle
|
@ -62,6 +62,7 @@ project(':forge') {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
repositories {
|
repositories {
|
||||||
|
mavenLocal()
|
||||||
mavenCentral()
|
mavenCentral()
|
||||||
}
|
}
|
||||||
patcher {
|
patcher {
|
||||||
|
@ -115,11 +116,11 @@ project(':forge') {
|
||||||
options.failOnError = false
|
options.failOnError = false
|
||||||
options.forkOptions.with {
|
options.forkOptions.with {
|
||||||
executable = 'java'
|
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 {
|
doFirst {
|
||||||
mkdir 'runclient'
|
mkdir 'runclient'
|
||||||
}
|
}
|
||||||
|
@ -132,7 +133,15 @@ project(':forge') {
|
||||||
// jvmArgs = ['-verbose:class']
|
// jvmArgs = ['-verbose:class']
|
||||||
classpath sourceSets.main.runtimeClasspath
|
classpath sourceSets.main.runtimeClasspath
|
||||||
main 'net.minecraftforge.fml.LaunchTesting'
|
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'
|
workingDir 'runclient'
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -24,6 +24,15 @@
|
||||||
if (this.gameSettings.fullScreen && !this.field_195558_d.func_198113_j()) {
|
if (this.gameSettings.fullScreen && !this.field_195558_d.func_198113_j()) {
|
||||||
this.field_195558_d.func_198077_g();
|
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 @@
|
@@ -1392,6 +1395,7 @@
|
||||||
NetworkManager networkmanager = NetworkManager.provideLocalClient(socketaddress);
|
NetworkManager networkmanager = NetworkManager.provideLocalClient(socketaddress);
|
||||||
networkmanager.setNetHandler(new NetHandlerLoginClient(networkmanager, this, (GuiScreen)null, (p_209507_0_) -> {
|
networkmanager.setNetHandler(new NetHandlerLoginClient(networkmanager, this, (GuiScreen)null, (p_209507_0_) -> {
|
||||||
|
|
|
@ -70,7 +70,7 @@ public class LaunchTesting
|
||||||
private static void hackNatives()
|
private static void hackNatives()
|
||||||
{
|
{
|
||||||
String paths = System.getProperty("java.library.path");
|
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))
|
if (Strings.isNullOrEmpty(paths))
|
||||||
paths = nativesDir;
|
paths = nativesDir;
|
||||||
|
|
Loading…
Reference in a new issue