Skip to content

Xeloboyo/airships-fabric-loader

Repository files navigation

Airships Fabric Modloader

This is a modloader based on Mindustry Game Provider to load fabric mods for Airships Conquer the skies

How Fabric Loader works

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.

Files and Folders

  • art/xeloboyo/airshipsloader/gameprovider/services This package contains
  • art/xeloboyo/airshipsloader/gameprovider/patch This package contains AMS2 bytecode patches that are always applied by the loaded.
    The AirshipsEntrypointPatch injects the game initialization hooks.
    The AirshipsBrandingPatch 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

Footnotes

  1. Fabric is a lightweight, experimental modding toolchain for Minecraft. fabricmc.net

  2. ASM is an all purpose Java bytecode manipulation and analysis framework. asm.ow2.io 2

  3. Mixin is a trait/mixin and bytecode weaving framework for Java using ASM. GitHub

  4. KnotClient.java

  5. The Fabric game launcher 2

  6. Knot.java#L173

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages