vectrix-space / ignite

A Mixin loader for Spigot/Paper/Velocity
MIT License
218 stars 17 forks source link
access-widener bukkit java minecraft mixins mod mod-loader paper paper-server spigot velocity
Ignite Logo

Ignite is a Mixin loader for Spigot/Paper.


![Build Status](https://github.com/vectrix-space/ignite/actions/workflows/build.yml/badge.svg) [![MIT License](https://img.shields.io/badge/license-MIT-blue)](license.txt) [![Discord](https://img.shields.io/discord/819522977586348052)](https://discord.gg/rYpaxPFQrj) [![Maven Central](https://img.shields.io/maven-central/v/space.vectrix.ignite/ignite-api?label=stable)](https://search.maven.org/search?q=g:space.vectrix.ignite%20AND%20a:ignite*) ![Sonatype Nexus (Snapshots)](https://img.shields.io/nexus/s/space.vectrix.ignite/ignite-api?label=dev&server=https%3A%2F%2Fs01.oss.sonatype.org)

Install

Download the ignite.jar from the releases page.

Place the ignite.jar into the same directory with your Minecraft Server jar (i.e paper.jar, spigot.jar or server.jar).

Run your original start command, but replace the normal server jar with ignite.jar. If you are using Java 8 you will need to add -javaagent:./ignite.jar to your start command.

If Ignite cannot start your server, you may need to add additional startup flags. See the Advanced Section below for more information. If you're still confused, be sure to ask for help.

The mods can then be placed into the mods directory that will be created.

Making a Mod

The ignite-mod-template is a template you can use to start a project for Paper without needing to do all the setup yourself.

To depend on the Ignite API in order to create your mod, you will need to add the following to your buildscript:

Gradle

repositories {
  mavenCentral()
  maven {
    url = "https://maven.fabricmc.net/"
  }
}

dependencies {
  compileOnly "space.vectrix.ignite:ignite-api:1.1.0"
  compileOnly "net.fabricmc:sponge-mixin:0.15.2+mixin.0.8.7"
  compileOnly "io.github.llamalad7:mixinextras-common:0.4.1"
}


Maven

<repositories>
  <repository>
    <url>https://maven.fabricmc.net/</url>
  </repository>
</repositories>

<dependencies>
  <dependency>
    <groupId>space.vectrix.ignite</groupId>
    <artifactId>ignite-api</artifactId>
    <version>1.1.0</version>
  </dependency>
  <dependency>
    <groupId>net.fabricmc</groupId>
    <artifactId>sponge-mixin</artifactId>
    <version>0.15.2+mixin.0.8.7</version>
  </dependency>
  <dependency>
    <groupId>io.github.llamalad7</groupId>
    <artifactId>mixinextras-common</artifactId>
    <version>0.4.1</version>
  </dependency>
</dependencies>

Note: To support custom mappings you should check out ignite-mod-template if you're running Paper. For Spigot check out Pacifist Remapper.

Configuring your Mod

Your mod will require a ignite.mod.json in order to be located as a mod. The ignite.mod.json provides the metadata needed to load your mixins and access wideners.

Example ignite.mod.json:

{
  "id": "example",
  "version": "1.0.0",
  "mixins": [
    "mixins.example.core.json"
  ],
  "wideners": [
    "example.accesswidener"
  ]
}

The mods will need to be placed in the directory the launcher will be targeting to load.

Using Mixins

The Mixin configuration files will need to be available in your mods binary in order to be loaded. The name of each configuration file should be added to the mixins section in your ignite.mod.json, or alternatively could be added to your jar manifest.

Mixin Specification

Using Access Wideners

The Access Wideners configuration files will need to be available in your mods binary in order to be loaded. The name of each configuration file should be added to the wideners section in your ignite.mod.json, or alternatively could be added to your jar manifest with the AccessWidener key.

Warning: Access wideners should only be used in situations where Mixin will not work!

Access Widener Specification

Advanced Usage

Ignite has some properties that can be set on startup to change the launch target, mod directory and more. The following could be added to your startup script:

Game Locators

Game locators provide platform specific modifications to the launch process. In some cases where the platform cannot be automatically detected, these flags can set the information it needs to launch.

The following targets could use the following flags:

Building

Note: If you do not have Gradle installed then use ./gradlew for Unix systems or Git Bash and gradlew.bat for Windows systems in place of any 'gradle' command.

In order to build Ignite you simply need to run the gradle build command. You can find the compiled JAR file in ./build/libs/ named 'ignite.jar'.

Inspiration

This project has many parts inspired by the following projects: