Giter VIP home page Giter VIP logo

Comments (2)

Cinder4198 avatar Cinder4198 commented on July 17, 2024

Turns out the natives folder is handled differently pre and post 1.19. Before, each version folder just had a natives folder with all the files in it, but after 1.19, it instead creates a new natives folder for each game launch, and removes it every time the game is quit. I tried manually making a new natives folder, but the game always clears it at the start of each launch, and copying the liblwjgl.so file I downloaded into it while its starting up didn't help.

The natives folder that minecraft generates on startup (when I'm using the normal minecraft launcher) is named '-natives-' and appears empty when I open it. I've been trying to figure out how to create my own natives folder and have the game use that, but I kind of have no idea what I'm doing so it's been kind of a struggle.

from mclauncher-api.

Cinder4198 avatar Cinder4198 commented on July 17, 2024

I made some code to work around the issue, its really scuffed but it works.
https://github.com/Cinder4198/MCLauncherAPINativesPatch

First, you want to use NativesVersionChecker to return a boolean for if the version needs the patch or not.
boolean isPost1_19 = new NativesVersionChecker().checker(<version>);

Then, if it returns true, use NativesDownloader to download the natives. You should run this after using MinecraftLauncherBackend.update. The first argument will be where your versions are stored, the second will be which version's natives to download, and the third will be which version folder to download them into. Usually the second and third argument will be the same, but this may not be the case if you're using a modded version or something.
if(isPost1_19)new NativesDownloader(<versionFolderLocation>, <versionNativesToDownload>, <versionFolderName>);

After that, use the NativesCommandPatcher to get a version of the launch command that will use the newly generated Natives folder instead of the default.

if(isPost1_19) patchedCommand = new NativesCommandPatcher().patcher(mcProcessBuilder.command(), profile.getVersion());

After that, just use the patched launch command in place of the normal one, then the game should launch. Hope this helps.

from mclauncher-api.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.