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

Inject interfaces to vanilla classes using JST #1765

Merged
merged 15 commits into from
Dec 15, 2024

Conversation

Matyrobbrt
Copy link
Member

This PR replaces patches with the purpose of adding interfaces to vanilla classes with a JST step. This removes another annoyance when porting as there will not be rejects caused by changes to the vanilla interfaces of classes.

To not affect userdev, we're now generating a second set of patches that will be published and that are based on the vanilla sources without interfaces, unlike the in-repo patches which are based on interface-injected sources.

@Matyrobbrt Matyrobbrt added ci/build Related to continuous integration/build system 1.21.4 Targeted at Minecraft 1.21.4 labels Dec 12, 2024
@neoforged-pr-publishing
Copy link

neoforged-pr-publishing bot commented Dec 12, 2024

  • Publish PR to GitHub Packages

Last commit published: d9954e16f76bec28facdabb939d6b316d60c83f7.

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 #1765' // https://github.com/neoforged/NeoForge/pull/1765
        url 'https://prmaven.neoforged.net/NeoForge/pr1765'
        content {
            includeModule('net.neoforged', 'neoforge')
            includeModule('net.neoforged', 'testframework')
        }
    }
}

MDK installation

In order to setup a MDK using the latest PR version, run the following commands in a terminal.
The script works on both *nix and Windows as long as you have the JDK bin folder on the path.
The script will clone the MDK in a folder named NeoForge-pr1765.
On Powershell you will need to remove the -L flag from the curl invocation.

mkdir NeoForge-pr1765
cd NeoForge-pr1765
curl -L https://prmaven.neoforged.net/NeoForge/pr1765/net/neoforged/neoforge/21.4.42-beta-pr-1765-jst-interface-injection/mdk-pr1765.zip -o mdk.zip
jar xf mdk.zip
rm mdk.zip || del mdk.zip

To test a production environment, you can download the installer from here.

@Technici4n Technici4n self-requested a review December 12, 2024 15:11
@neoforged-automation
Copy link

@Matyrobbrt, this pull request has conflicts, please resolve them for this PR to move forward.

@marchermans
Copy link
Contributor

How much has this been tested on the individual downstream platforms?

@Matyrobbrt
Copy link
Member Author

As much as the game launching (which also verifies that recomp is successful, therefore proving the patches are correct as otherwise there would be compilation errors due to missing interfaces and methods). This PR has little to no effect in userdev as the second set of patches hides the use of interface injection from any toolchain.

@marchermans
Copy link
Contributor

As much as the game launching (which also verifies that recomp is successful, therefore proving the patches are correct as otherwise there would be compilation errors due to missing interfaces and methods). This PR has little to no effect in userdev as the second set of patches hides the use of interface injection from any toolchain.

So in userdev this uses Patches? Instead of II?

@Technici4n
Copy link
Member

Yes exactly. See the generateProductionSourcePatches task.

@marchermans
Copy link
Contributor

Yes exactly. See the generateProductionSourcePatches task.

IMHO that is a lucky break, but not a great solution........ regardless, carry on, my curiosity has been satistied

Copy link
Member

@Technici4n Technici4n left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good! Final request: can you sort the injected interfaces file in a sensible way?

@Matyrobbrt
Copy link
Member Author

Done. I sorted them alphabetically, splitting enum extensions from the others

@Matyrobbrt Matyrobbrt added the keep rebased Add this label to a PR to keep it rebased continuously automatically label Dec 15, 2024
@Matyrobbrt Matyrobbrt enabled auto-merge (squash) December 15, 2024 12:21
@Matyrobbrt Matyrobbrt merged commit 52733f5 into neoforged:1.21.x Dec 15, 2024
6 checks passed
@neoforged-releases
Copy link

🚀 This PR has been released as NeoForge version 21.4.27-beta.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
1.21.4 Targeted at Minecraft 1.21.4 ci/build Related to continuous integration/build system keep rebased Add this label to a PR to keep it rebased continuously automatically
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants