BSDHacks

Quick rating

Community listing page, reviews here may not be monitored by the author.

BSDHacks

By exaptationsOwner

No reviews yet

Hacks to make Minecraft run better on FreeBSD and with mismatched LWJGL versions. Probably also helps with other BSDs?

Minecraft
26.2
1.17

About

Description

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.