Fix EXR rendering failing on Windows on MC 1.20+

This commit is contained in:
Jonas Herzig
2023-11-27 17:02:02 +01:00
parent 329ac51309
commit e8f9234bf0

View File

@@ -33,9 +33,15 @@ public class Lwjgl3Loader extends URLClassLoader {
Path nativesDir = ReplayMod.instance.folders.getCacheFolder().resolve("lwjgl-natives"); Path nativesDir = ReplayMod.instance.folders.getCacheFolder().resolve("lwjgl-natives");
Class<?> configClass = Class.forName("org.lwjgl.system.Configuration", true, this); Class<?> configClass = Class.forName("org.lwjgl.system.Configuration", true, this);
Object extractDirField = configClass.getField("SHARED_LIBRARY_EXTRACT_DIRECTORY").get(null);
Method setMethod = configClass.getMethod("set", Object.class); Method setMethod = configClass.getMethod("set", Object.class);
setMethod.invoke(extractDirField, nativesDir.toAbsolutePath().toString()); setMethod.invoke(
configClass.getField("SHARED_LIBRARY_EXTRACT_DIRECTORY").get(null),
nativesDir.toAbsolutePath().toString()
);
setMethod.invoke(
configClass.getField("SHARED_LIBRARY_EXTRACT_PATH").get(null),
(Object) null
);
} }
private boolean canBeSharedWithMc(String name) { private boolean canBeSharedWithMc(String name) {