Pierce01 / MinecraftLauncher-core

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

[Feature request] Library overrides #91

Open H4kt opened 2 years ago

H4kt commented 2 years ago

I would like to be able to dynamically override a library.

Example use case: Our launcher has custom auth service and thus requires us to provide our custom AuthLib instead of the vanilla one.

Example configuration syntax:

const opts = {
  ...
  overrides: {
    libraries: {
      "com.mojang:authlib:<=3.2.38": {
        url: "https://custom.io/",
        name: "io.custom:authlib:3.2.38",
        sha1: "<sha1 here>"
      }
    }
  }
}

Result: MCLC will not download mojang's AuthLib but will download a custom one instead and launch game using it.

AarushX commented 2 years ago

I don't know too much about this specifically but there are a few ways you may be able to achieve this:

  1. Change the version.json file to use your custom libraries
  2. Allow downloading of the other libraries by MCLC then overriding then with your libraries, then allowing a launch (patching)
  3. Combination of 1 and 2 with the custom library folder

Apologies if I didn't respond to your issue with exactly what you're looking for, but in the meantime these may work!

Pierce01 commented 2 years ago

This is a great idea! This would enable quick library overrides which would streamline a lot of things for quick modifications.

I'll add this in when making the next patch/update. I'll close the issue when it gets added.