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 Java Core Mods #79

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open

Add Java Core Mods #79

wants to merge 4 commits into from

Conversation

shartte
Copy link
Contributor

@shartte shartte commented Jan 21, 2024

Mods must ship a separate Jar-file (for example via jar-in-jar) and mark it as FMLModType: LIBRARY to make it load above the GAME layer. They then must provide an implementation of ICoreMod via the Java ServiceLoader to contribute their transformers.

This tries to avoid loading the script-engine based coremod library unless any modfile contains such coremod scripts.

@Technici4n
Copy link
Member

We do not have generics for ITransformer yet. :P

@shartte
Copy link
Contributor Author

shartte commented Jan 22, 2024

@Technici4n You will notice that it did compile (yes, yes, license violation...) with FML head, so I think we do ;-)

@Technici4n
Copy link
Member

Ah, yes we do. Didn't read why the build was failing. 😁

Good idea in any case. We can change the interface later but for now this is good enough. I also expect noticeable startup time improvements once we move the NF coremods to this.

@neoforged-pr-publishing
Copy link

neoforged-pr-publishing bot commented Apr 5, 2024

  • Publish PR to GitHub Packages

Last commit published: b35e1c81e5db14ec35b5c167025c8b92cf903e1c.

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 #79' // https://github.com/neoforged/FancyModLoader/pull/79
        url 'https://prmaven.neoforged.net/FancyModLoader/pr79'
        content {
            includeModule('net.neoforged.fancymodloader', 'earlydisplay')
            includeModule('net.neoforged.fancymodloader', 'loader')
            includeModule('net.neoforged.fancymodloader', 'junit-fml')
        }
    }
}

@neoforged-compatibility-checks
Copy link

neoforged-compatibility-checks bot commented Apr 27, 2024

@shartte, this PR introduces breaking changes.
Fortunately, this project is currently accepting breaking changes, but if they are not intentional, please revert them.
Last checked commit: b35e1c81e5db14ec35b5c167025c8b92cf903e1c.

loader (:loader)

  • net/neoforged/fml/loading/ModSorter
    • sort(Ljava/util/List;Ljava/util/List;)Lnet/neoforged/fml/loading/LoadingModList;: ❗ API method was removed
  • net/neoforged/fml/loading/moddiscovery/CoreModFile
    • ❗ Class was made final
    • ❗ Class missing interface: net/neoforged/coremod/ICoreModScriptSource
    • getDebugSource()Ljava/lang/String;: ❗ API method was removed
    • getOwnerId()Ljava/lang/String;: ❗ API method was removed
    • toString()Ljava/lang/String;: ❗ Method was made final
    • getAdditionalFile(Ljava/lang/String;)Ljava/io/Reader;: ❗ API method was removed
    • readCoreMod()Ljava/io/Reader;: ❗ API method was removed
  • net/neoforged/fml/loading/LoadingModList
    • of(Ljava/util/List;Ljava/util/List;Ljava/util/List;Ljava/util/Map;)Lnet/neoforged/fml/loading/LoadingModList;: ❗ API method was removed
    • addCoreMods()V: ❗ API method was removed

Mods must ship a separate Jar-file (for example via jar-in-jar) and mark it as FMLModType: LIBRARY to make it load above the GAME layer. They then must provide an implementation of ICoreMod via the Java ServiceLoader to contribute their transformers.
@shartte shartte requested a review from Matyrobbrt May 30, 2024 23:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants