This is a modloader based on Mindustry Game Provider to load fabric mods for Airships Conquer the skies
Fabric1 uses Java bytecode manipulation powered by ASM2 to inject the loader and mod's mixin3 code into the game classes as they are loaded.
To do this, fabric has to run code before the game is even loaded. In fact, when launching a game with fabric, the entry class is not one of the game but KnotClient4.
Knot5 is fabric's game launcher.
It is responsible for setting up the injection and calling your game provider
before jumping to the game's entry point (e.g.: main
function).
The game provider's job is to provide information to fabric and inject initialization hooks that can be used by mods.
For example ModInitializer#onInitialize is made possible by hook that is provided by the game provider.
art/xeloboyo/airshipsloader/gameprovider/services
This package containsart/xeloboyo/airshipsloader/gameprovider/patch
This package contains AMS2 bytecode patches that are always applied by the loaded.
TheAirshipsEntrypointPatch
injects the game initialization hooks.
TheAirshipsBrandingPatch
injects some code to show "Modded Fabric" on the main menu.META-INF/services/net.fabricmc.loader.impl.game.GameProvider
This file is used by Knot5 to determine the GameProvider class6.
It has to contain exactly one line with the fully-qualified class name.
Footnotes
-
Fabric is a lightweight, experimental modding toolchain for Minecraft. fabricmc.net ↩
-
ASM is an all purpose Java bytecode manipulation and analysis framework. asm.ow2.io ↩ ↩2
-
Mixin is a trait/mixin and bytecode weaving framework for Java using ASM. GitHub ↩