BSDHacks
用于在 FreeBSD 上运行 Minecraft 以及处理不匹配的 LWJGL 版本的修复补丁。
(可能也对其他 BSD 系统有帮助?)
当前修复内容
Sodium 因 LWJGL 版本不匹配导致游戏启动时崩溃
[main/ERROR]: The game failed to start because the currently active LWJGL version is not compatible.
Installed version: 3.4.3-snapshot
Required version: 3.3.1
It appears you are using Prism Launcher to start the game. You can likely fix this problem by opening your instance settings and navigating to the Versionsection in the sidebar.
For more information, please see: https://link.caffeinemc.net/help/sodium/runtime-issue/lwjgl3/gh-2561
通过在 premain 阶段设置 -Dsodium.checks.issue2561=false 来修复。
(~1.20.1) Vorbis 音频无法播放
这是由于 STBVorbisInfo.mallocStack 内部发生了 NoSuchMethodError,而 Mojang 进行的异步 CompletableFuture 操作以一种奇怪的方式吞没了这个错误。LWJGL 在经过长时间的弃用期后移除了这些方法。
mallocStack 方法会被动态地重新修补到所有具有相应结构特征的类中。
(~1.20.1) 世界图标无效
[IO-Worker-35/ERROR]: Caught exception in thread Thread[IO-Worker-35,10,main]
java.lang.NoSuchMethodError: 'int org.lwjgl.stb.STBImageResize.nstbir_resize_uint8(long, int, int, int, long, int, int, int, int)'
at net.minecraft.class_1011.method_4300([NativeImage.resizeSubRectTo]:630)
at net.minecraft.class_757.method_3181([GameRenderer.method_3181]:1024)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
at java.lang.Thread.run(Thread.java:840)
nstbir_resize_uint8 的返回类型有误,已被更改为 long。此外,所有不带后缀的方法都被移除了。
该方法的损坏变体被重新修补,并委托调用 nstbir_resize_uint8_srgb。
(~1.21.1) 无用的 GLFW 初始化错误
以下异常中的某种变体将被显示,而不是实际的 GLFW 错误:
java.lang.NoSuchMethodError: 'boolean org.lwjgl.util.tinyfd.TinyFileDialogs.tinyfd_messageBox(java.lang.CharSequence, java.lang.CharSequence, java.lang.CharSequence, java.lang.CharSequence, boolean)'
返回类型已从 boolean 更改为 int。旧版方法已被重新修补。
(~1.20.1) 无用的 GLFW 初始化错误 2
java.lang.IllegalStateException: Failed to initialize GLFW, errors: GLFW error during init: [0x1000E]63553497619776
at knot//com.mojang.blaze3d.platform.GLX._initGlfw(GLX.java:75)
at knot//com.mojang.blaze3d.systems.RenderSystem.initBackendSystem(RenderSystem.java:847)
at knot//net.minecraft.class_310.<init>(class_310.java:483)
at knot//net.minecraft.client.main.Main.main(Main.java:211)
at net.fabricmc.loader.impl.game.minecraft.MinecraftGameProvider.launch(MinecraftGameProvider.java:514)
at net.fabricmc.loader.impl.launch.knot.Knot.launch(Knot.java:72)
at net.fabricmc.loader.impl.launch.knot.KnotClient.main(KnotClient.java:23)
at org.prismlauncher.launcher.impl.StandardLauncher.launch(StandardLauncher.java:115)
at org.prismlauncher.EntryPoint.listen(EntryPoint.java:129)
at org.prismlauncher.EntryPoint.main(EntryPoint.java:70)
原版代码会打印 GLFW 错误消息的 原始指针值,而不是跟随指针读取字符串。
代码已修补以使用 MemoryUtil.memUTF8。
已知未修复问题
(Flywheel 1.21.1) 进入世界后随机出现 SIGSEGV/SIGBUS
目前尚不清楚原因。将 Flywheel 后端设置为 flywheel:off 可以解决此问题,但并非理想方案。使用 Epsilon GC 也能修复……?
即使没有任何实际使用 Flywheel 进行渲染或甚至 安装 的内容,游戏也会崩溃。
BSDHacks
Hacks to make Minecraft run better on FreeBSD and with mismatched LWJGL versions.
(Probably also helps with other BSDs?)
Current Fixes
Sodium crashing the game on start due to the mismatched LWJGL version
[main/ERROR]: The game failed to start because the currently active LWJGL version is not compatible.
Installed version: 3.4.3-snapshot
Required version: 3.3.1
It appears you are using Prism Launcher to start the game. You can likely fix this problem by opening your instance settings and navigating to the Versionsection in the sidebar.
For more information, please see: https://link.caffeinemc.net/help/sodium/runtime-issue/lwjgl3/gh-2561
Fixed by setting -Dsodium.checks.issue2561=false during premain.
(~1.20.1) Vorbis audio not playing
This is caused by an internal NoSuchMethodError on STBVorbisInfo.mallocStack that gets swallowed by the weird async CompletableFuture bullshit Mojang is doing. LWJGL removed these methods after a pretty long deprecation period.
mallocStack methods get dynamically patched back in to all classes that are shaped like they should have one.
(~1.20.1) World icons do not work
[IO-Worker-35/ERROR]: Caught exception in thread Thread[IO-Worker-35,10,main]
java.lang.NoSuchMethodError: 'int org.lwjgl.stb.STBImageResize.nstbir_resize_uint8(long, int, int, int, long, int, int, int, int)'
at net.minecraft.class_1011.method_4300([NativeImage.resizeSubRectTo]:630)
at net.minecraft.class_757.method_3181([GameRenderer.method_3181]:1024)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
at java.lang.Thread.run(Thread.java:840)
nstbir_resize_uint8 had the wrong return type, and was changed to long. Additionally, all the non-suffixed methods got removed.
The broken variant of this method is patched back in, delegating to nstbir_resize_uint8_srgb.
(~1.21.1) Useless GLFW Init Errors
Some variant of the following exception will be displayed instead of the actual GLFW error:
java.lang.NoSuchMethodError: 'boolean org.lwjgl.util.tinyfd.TinyFileDialogs.tinyfd_messageBox(java.lang.CharSequence, java.lang.CharSequence, java.lang.CharSequence, java.lang.CharSequence, boolean)'
The return type was changed from boolean to int. The old method is patched back in.
(~1.20.1) Useless GLFW Init Errors 2
java.lang.IllegalStateException: Failed to initialize GLFW, errors: GLFW error during init: [0x1000E]63553497619776
at knot//com.mojang.blaze3d.platform.GLX._initGlfw(GLX.java:75)
at knot//com.mojang.blaze3d.systems.RenderSystem.initBackendSystem(RenderSystem.java:847)
at knot//net.minecraft.class_310.<init>(class_310.java:483)
at knot//net.minecraft.client.main.Main.main(Main.java:211)
at net.fabricmc.loader.impl.game.minecraft.MinecraftGameProvider.launch(MinecraftGameProvider.java:514)
at net.fabricmc.loader.impl.launch.knot.Knot.launch(Knot.java:72)
at net.fabricmc.loader.impl.launch.knot.KnotClient.main(KnotClient.java:23)
at org.prismlauncher.launcher.impl.StandardLauncher.launch(StandardLauncher.java:115)
at org.prismlauncher.EntryPoint.listen(EntryPoint.java:129)
at org.prismlauncher.EntryPoint.main(EntryPoint.java:70)
Vanilla prints the raw pointer value of the GLFW error message instead of following it and reading the string.
The code is patched to use MemoryUtil.memUTF8.
Known Unfixed Problems
(Flywheel 1.21.1) Random SIGSEGV/SIGBUS after joining a world
No idea as to a cause for this yet. Setting the Flywheel backend to flywheel:off works, but is not ideal. Using the Epsilon GC also fixes it...?
Nothing that actually uses Flywheel needs to be rendering or even installed for the game to crash.
评论 0
登录后参与评分
还没有评论,来抢沙发吧