Giter VIP home page Giter VIP logo

airships-fabric-loader's Introduction

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

airships-fabric-loader's People

Contributors

xeloboyo avatar

Watchers

 avatar

Forkers

ishimoss

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.