Pierce01 / MinecraftLauncher-core

Lightweight module that downloads and runs Minecraft using javascript / NodeJS
MIT License
359 stars 82 forks source link

OS Edgecase: MacOS Catalina (10.15.2) #35

Closed Tobishua closed 4 years ago

Tobishua commented 4 years ago

Hello! I just tried to use example from this repository and received exception after launch: Exception in thread "main" java.lang.UnsatisfiedLinkError: no lwjgl in java.library.path: [/Users/Tobishua/tests/minecraft/natives/1.12.2] at java.base/java.lang.ClassLoader.loadLibrary(ClassLoader.java:2670) at java.base/java.lang.Runtime.loadLibrary0(Runtime.java:806) at java.base/java.lang.System.loadLibrary(System.java:1909) at org.lwjgl.Sys$1.run(Sys.java:73) at java.base/java.security.AccessController.doPrivileged(AccessController.java:312) at org.lwjgl.Sys.doLoadLibrary(Sys.java:66) at org.lwjgl.Sys.loadLibrary(Sys.java:95) at org.lwjgl.Sys.<clinit>(Sys.java:112) at bib.I(SourceFile:2825) at net.minecraft.client.main.Main.main(SourceFile:38)

Here is my test script (I've leave example code from this repository): `const { Client, Authenticator } = require('minecraft-launcher-core'); const launcher = new Client();

let opts = { clientPackage: null, // For production launchers, I recommend not passing // the getAuth function through the authorization field and instead // handling authentication outside before you initialize // MCLC so you can handle auth based errors and validation! authorization: Authenticator.getAuth("---------", "---------"), root: "./minecraft", os: "osx", version: { number: "1.12.2", type: "release" }, memory: { max: "4000", min: "1000" } }

launcher.launch(opts);

launcher.on('debug', (e) => console.log(e)); launcher.on('data', (e) => console.log(e));`

Pierce01 commented 4 years ago

Looks like it's failing to add the lwjgl native to the native folder. Will need to look into, not sure how long it will take since I don't have access to a system with Catalina. Will keep you posted.

Tobishua commented 4 years ago

@Pierce01 Thank you advance! If necessary, I'm always ready to test.

Tobishua commented 4 years ago

@Pierce01 I'm really sorry, but in my script os: "osx" was missing after adding Minecraft starts successfully. Then I think it's bug in OS detection.

Pierce01 commented 4 years ago

So you're saying after you added the OS to the launch options it works? Yeah, that's a bug

Tobishua commented 4 years ago

Yes, after I added os: "osx" option it works.

Pierce01 commented 4 years ago

What's returned when you do process.platform?

Tobishua commented 4 years ago

It returns "darwin".

Pierce01 commented 4 years ago

Screenshot_20200128-175713_Samsung Internet

Huh... wonder why it's not working then

Tobishua commented 4 years ago

Hm... It's really weird: just checked on my other MacBook with the same macOS version and it works without os parameter. I think something is wrong with my first MacBook 🤔 I think you can close this issue. I apologize for the concern.

Pierce01 commented 4 years ago

Leaving open just incase another person experiances this issue

KodeurKubik commented 8 months ago

I also face this issue :/