Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add the ability to inject interfaces into Minecraft classes #83

Merged
merged 12 commits into from
Jul 6, 2024
Merged

Conversation

shartte
Copy link
Collaborator

@shartte shartte commented Jul 6, 2024

Interface Injection

Interface injection is an advanced feature allowing mods to add additional interfaces to Minecraft classes and interfaces
at development time. This feature requires that mods use ASM or Mixins to make the same extensions at runtime.

To use this feature, place an interface injection data-file in your project and configure the interfaceInjectionData property to include it.
Since this feature only applies at development time, you do not need to include this data file in your jar.

Important

This feature only applies at development time. You need to use Mixins or Coremods to make it work at runtime.

build.gradle

neoForge {
    interfaceInjectionData = files("interfaces.json")
}

interfaces.json

{
  "net/minecraft/world/item/ItemStack": [
    "testproject/FunExtensions"
  ]
}

In addition, you can add additional data-files to the interfaceInjectionData configuration using normal
Project dependency syntax in your dependencies block.

Fixes #82

@neoforged-pr-publishing
Copy link

neoforged-pr-publishing bot commented Jul 6, 2024

  • Publish PR to GitHub Packages

Last commit published: 69be9ed6fa751ff8f38c4b069fb8855aa41eee46.

PR Publishing

The artifacts published by this PR:

Repository Declaration

In order to use the artifacts published by the PR, add the following repository to your buildscript:

repositories {
    maven {
        name 'Maven for PR #83' // https://github.com/neoforged/ModDevGradle/pull/83
        url 'https://prmaven.neoforged.net/ModDevGradle/pr83'
        content {
            includeModule('net.neoforged.moddev.repositories', 'net.neoforged.moddev.repositories.gradle.plugin')
            includeModule('net.neoforged.moddev', 'net.neoforged.moddev.gradle.plugin')
            includeModule('net.neoforged', 'moddev-gradle')
        }
    }
}

README.md Outdated Show resolved Hide resolved
@Technici4n Technici4n enabled auto-merge (squash) July 6, 2024 14:44
@Technici4n Technici4n merged commit b2158f3 into main Jul 6, 2024
3 checks passed
@Technici4n Technici4n deleted the fix-82 branch July 6, 2024 14:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Injected interfaces based on Asm
3 participants