AnOpenSauceDev / FastRandom

An optimized rewrite of Minecraft's RNG system, for Fabric!
Apache License 2.0
48 stars 3 forks source link

Headless JDK's cause crashes #49

Closed Y1rd closed 5 months ago

Y1rd commented 5 months ago

Does an issue already cover this?

Does your system support Faster Random?

Issue description.

If you are on a linux distro and using Wayland window manager (e.g. hyprland), the game will crash upon startup.

Issue replication.

  1. Run a Wayland window manager
  2. Start Minecraft with the mod installed

Log File / Crash Report (if applicable)

https://mclo.gs/tOXu1K7 (Note: Ignore Mod Menu conflict, it does not crash the game.)

AnOpenSauceDev commented 5 months ago

This is technically not an issue with X11 or Wayland at all. What's happening is that your JVM does not support L64X128MixRandom (Line 330), and the popup warning you about that is likely crashing the game (because wayland likely hates that).

Y1rd commented 5 months ago

Ah, thanks. I'm using OpenJDK 22, so I assume that is the issue I guess.

AnOpenSauceDev commented 5 months ago

That shouldn't be a problem, Faster Random just needs JEP 356 implemented. It's strange that OpenJDK 22 of all things is having trouble with it considering that OpenJDK's above 17 should have this implemented.

Y1rd commented 5 months ago

That shouldn't be a problem, Faster Random just needs JEP 356 implemented. It's strange that OpenJDK 22 of all things is having trouble with it considering that OpenJDK's above 17 should have this implemented.

I just started up the game with OpenJDK 17 and it booted just fine, is OpenJDK 22 missing JEP 356?

AnOpenSauceDev commented 5 months ago

Must be. What is the actual name of the JDK, and did you get it from your package manager?

Y1rd commented 5 months ago

Must be. What is the actual name of the JDK, and did you get it from your package manager?

So, I figured out the issue. I had jre-openjdk-headless installed instead of jdk-openjdk. Woops. OpenJDK 22 works just fine now.

On another note, I'm suprised Minecraft worked with headless jre and I never noticed until now.

AnOpenSauceDev commented 5 months ago

I wonder if that's the major cause of so many people having the wrong JDK. Not only does it seem to not have the generators for some reason, displaying the popup will cause a crash due to it being headless.

Minecraft probably works fine since LWJGL talks to many native libraries which could bypass Java's systems.

Y1rd commented 5 months ago

Huh, guess we've uncovered something interesting.

AnOpenSauceDev commented 5 months ago

It's more interesting in the case of: "Why isn't RandomGenerator included in a version of a JDK that only should remove some graphical/input features?" It's quite annoying, and I don't really have a way to tell users that they have a broken package without spawning another process (which in light of recent events, is a bad idea).

Y1rd commented 5 months ago

Was going to say to edit the jvm list, but you already did. Also, yeah... and it seems kinda silly to remove that.