Skip to content

Support for source enum extension#62

Open
lukebemish wants to merge 9 commits intoneoforged:mainfrom
lukebemish:enum-extension
Open

Support for source enum extension#62
lukebemish wants to merge 9 commits intoneoforged:mainfrom
lukebemish:enum-extension

Conversation

@lukebemish
Copy link
Copy Markdown
Contributor

@lukebemish lukebemish commented Feb 15, 2026

In light of the recent discussion on discord -- this seems like a useful thing to have in-source support for, right?

Like interface injection, JST has to generate stubs occasionally here -- for the EnumProxy fields or parameter providing methods that enum extensions can use.

This PR is marked as a draft for now. It is blocked by:

In particular -- FML needs to handle cases where enum entries to be injected exist already gracefully, including handling ordering so that "dev env with source-injected plus runtime-injected-from-a-dependency enum entries" and "prod server being tested against" get the same enum ordering.

This system validates that the targeted class extends a provided interface (presumably, you'd pass it IExtensibleEnum for neoforge-mode, and nothing for "vanilla" mode).

One question I have -- I currently hard-code the EnumProxy class used in stubs. Should this be un-hard-coded as an argument or the like?

@neoforged-pr-publishing
Copy link
Copy Markdown

neoforged-pr-publishing bot commented Feb 15, 2026

  • Publish PR to GitHub Packages

Last commit published: f6b881712d335b77985df7f8127e0061db9a1c23 - version: 2.0.17-pr-62-enum-extension

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 #62" // https://github.com/neoforged/JavaSourceTransformer/pull/62
        url = uri("https://prmaven.neoforged.net/JavaSourceTransformer/pr62")
        content {
            includeModule("net.neoforged.jst", "jst-api")
            includeModule("net.neoforged.jst", "jst-cli")
            includeModule("net.neoforged.jst", "jst-cli-bundle")
        }
    }
}

@lukebemish
Copy link
Copy Markdown
Contributor Author

Whoops, just realized I think there's some indexed-enum stuff or the like this needs to support, I'll add that to the TODO list too

@lukebemish lukebemish marked this pull request as ready for review April 3, 2026 20:08
@lukebemish
Copy link
Copy Markdown
Contributor Author

PR publishing is currently failing due to the fat cli jar being too big or something...

@sciwhiz12
Copy link
Copy Markdown
Member

Fixed. We increased the limit of PR publishing to 75 MB.

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.

2 participants