Add a generic GameProvider for non-minecraft applications
See original GitHub issueFor 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:
- Created 2 years ago
- Comments:5 (4 by maintainers)
Top 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 >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
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.
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.