3arthqu4ke / headlessmc

Minecraft on the command line
https://3arthqu4ke.github.io/headlessmc/
MIT License
142 stars 16 forks source link

Add support for ARM architecture (Raspberry Pi) #184

Closed huangdihd closed 1 month ago

huangdihd commented 1 month ago

I’m trying to run HeadlessMc on my Raspberry Pi, but running java -jar ./headlessmc-launcher-2.0.0.jar results in the following error:

[18:16:44] [main/WARNING] [Main]: You are not running from headlessmc-launcher-wrapper. Some things will not work properly!
[18:16:45] [main/SEVERE] [Main]: 
java.lang.IllegalArgumentException: No enum constant me.earth.headlessmc.launcher.os.OS.Type.UNKNOWN
        at java.base/java.lang.Enum.valueOf(Enum.java:240)
        at me.earth.headlessmc.launcher.os.OS$Type.valueOf(OS.java:18)
        at me.earth.headlessmc.launcher.version.RuleFactory.ofOs(RuleFactory.java:77)
        at me.earth.headlessmc.launcher.version.RuleFactory.parseOs(RuleFactory.java:73)
        at me.earth.headlessmc.launcher.version.RuleFactory.parse(RuleFactory.java:47)
        at me.earth.headlessmc.launcher.version.RuleFactory.parse(RuleFactory.java:30)
        at me.earth.headlessmc.launcher.version.ArgumentFactory.parseElement(ArgumentFactory.java:67)
        at me.earth.headlessmc.launcher.version.ArgumentFactory.parse(ArgumentFactory.java:42)
        at me.earth.headlessmc.launcher.version.VersionFactory.parse(VersionFactory.java:37)
        at me.earth.headlessmc.launcher.version.DefaultVersionFactory.parse(DefaultVersionFactory.java:3)
        at me.earth.headlessmc.launcher.version.VersionService.read(VersionService.java:66)
        at me.earth.headlessmc.launcher.version.VersionService.update(VersionService.java:47)
        at me.earth.headlessmc.launcher.Service.refresh(Service.java:21)
        at me.earth.headlessmc.launcher.Service.refresh(Service.java:13)
        at me.earth.headlessmc.launcher.Main.runHeadlessMc(Main.java:88)
        at me.earth.headlessmc.launcher.Main.main(Main.java:35)

Additionally, there is no linux/arm64/v8 Docker image available. Could you please add support for ARM processors?

Thanks!

3arthqu4ke commented 1 month ago

Ok, the IllegalArgumentException should be unrelated, what versions are in your .minecraft/versions? Ill fix it, knowing that would help.

Yes, I can try to make Docker images for other architectures. Right now I can only support launching on ARM in headless mode with the -lwjgl flag. I will need to look into providing the correct lwjgl binaries for that sometime.

3arthqu4ke commented 1 month ago

The 3arthqu4ke/headlessmc:latest image should now support amd64 and arm64. https://hub.docker.com/layers/3arthqu4ke/headlessmc/latest/images/sha256-260ddc4e1ffbcecf6ba598a8b8cfbf4a73a43362c13147d8717beb0b459adaa7?context=explore

For the IllegalArgumentException please tell me what version.jsons are in your .minecraft/versions and if they have been put there by another launcher or something?

huangdihd commented 1 month ago

Thank you for your help. HMCL had put some Minecraft versions in the .minecraft folder, and I deleted them. After that, it ran successfully.