Giter Club home page Giter Club logo

mixinextras's Introduction

MixinExtras

A small companion library to Mixin, designed to help you write your Mixins in a more expressive and compatible way.

More information about each feature offered can be found at the Wiki.

Setup

For the time being, I recommend depending on this library via JitPack. After adding its repository to your build script, you can depend on it like so

dependencies {
    implementation("com.github.LlamaLad7:MixinExtras:0.1.1")
    annotationProcessor("com.github.LlamaLad7:MixinExtras:0.1.1")
}

It is essential that you register MixinExtras as an annotation processor if you want remapping of custom features to work. If you are registering Mixin as an annotation processor too, you must register the MixinExtras annotation processor before the Mixin one.

Bundling MixinExtras

If you intend to use this library in your mod, you will probably need to bundle it in your jar.

If you are on Fabric, I recommend using the include configuration in your dependencies block.

If you are on another platform, I recommend the Shadow Gradle Plugin. You also need to relocate MixinExtras to avoid conflicts with different versions of the library, and you need to tell the plugin to mergeServiceFiles if you are on Java 9+.

Initialization

The final step after setting up your build script is to initialize MixinExtras. To do this, simply call

MixinExtrasBootstrap.init();

somewhere suitably early in your program. On Fabric, this would be a PreLaunch entrypoint. If you cannot find a suitable place for your platform, you might like to use an IMixinConfigPlugin . Initializing MixinExtras in your plugin's onLoad method should work fine on any platform (except Fabric loader <= 0.14.10! [1]).

You're good to go!

Enjoy using the library, and don't hesitate to open an issue if you have any feedback, questions or suggestions.

Footnotes

[1] FabricLoader had an issue meaning a crash occurred if the very first class loaded on KnotClassLoader was also referenced from a mixin plugin. MixinExtrasBootstrap is frequently the first class loaded there since lots of people initialize it from a preLaunch entrypoint. As such, please do that and do not initialize it from a mixin plugin. This has been resolved in Fabric Loader 0.14.11, but that's not very widely used yet.

mixinextras's People

Contributors

llamalad7 avatar

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.