question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Add a generic GameProvider for non-minecraft applications

See original GitHub issue

For many other applications, fabric loader’s ability to load mods and apply mixins is a great thing to have, and since FLoader is (mostly) abstracted away from minecraft, it’s a good idea to add support for third-party applicatons.

I propose adding two new game providers (names are just placeholders):

  • InjectedGameProvider

    • Goal: Use FLoader for applications which do not natively support it
    • It needs to specify the main class (if floader detects this isn’t present it’ll fail or ignore depending on the implementation)
    • It needs to have an inject() method which modifies the ASM or uses the game’s internals to inject itself
  • ImplementedGameProvider

    • Goal: Allow game/application devs to use floader as a plugin/module system
    • It needs to specify the main class as before, but floader will handle initialization and running the code (perhaps an interface the main class needs to implement?)

Another idea is to use java’s service system (the same one spongepowered/mixin uses) to specify the gameprovider to be used in your program, rather than adding it to the GameProviders class.

Ideal situation (for developers aiming to use fabric loader in a project):

  • implementation "net.fabricmc:fabric-loader:version" in gradle
  • Implement a custom GameProvider
  • Register it (either through a service file or a registry of some sort)

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:5 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
sfPlayer1commented, Jul 29, 2021

The mincraft module is the reference for now. All you really need is a provider configuration file like https://github.com/FabricMC/fabric-loader/blob/master/minecraft/src/main/resources/META-INF/services/net.fabricmc.loader.impl.game.GameProvider and the referenced game provider implementation on the class path. Loader will then use your game provider if its embedded one can’t locate the game or is disabled (-Dfabric.skipMcProvider).

Note that this is not API, so you’d target the implementation of a specific loader version without any API stability guarantees.

1reaction
sfPlayer1commented, Jul 29, 2021

Game providers are now relatively easy to add, I also added -Dfabric.skipMcProvider to force-disable the embedded mc provider in case someone wants to replace it even if it’d still match the game otherwise.

I’ll close the issue since I believe the bulk of the suggestion is more or less covered now.

Read more comments on GitHub >

github_iconTop Results From Across the Web

IssuerUri from appsettings.json is ignored - DuendeSoftware ...
Add a generic GameProvider for non-minecraft applications, 5, 2021-05-23, 2022-07-16. Fails silently if buildkite-agent isn't available, 5, 2019-04-23 ...
Read more >
Admincraft Monthly Marketplace - Reddit
Welcome to the monthly Admincraft Marketplace! This thread is for everything buy/sell related. Here, users can seek out or leave reviews for ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found