-
-
Notifications
You must be signed in to change notification settings - Fork 179
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
Convert Coremods from JS to Java #785
Conversation
Last commit published: b41b9de4c07b88b3a0cb19c80787f71bf60d2803. PR PublishingThe artifacts published by this PR:
Repository DeclarationIn order to use the artifacts published by the PR, add the following repository to your buildscript: repositories {
maven {
name 'Maven for PR #785' // https://github.com/neoforged/NeoForge/pull/785
url 'https://prmaven.neoforged.net/NeoForge/pr785'
content {
includeModule('net.neoforged', 'testframework')
includeModule('net.neoforged', 'neoforge')
}
}
} MDK installationIn order to setup a MDK using the latest PR version, run the following commands in a terminal. mkdir NeoForge-pr785
cd NeoForge-pr785
curl -L https://prmaven.neoforged.net/NeoForge/pr785/net/neoforged/neoforge/21.1.60-pr-785-coremods/mdk-pr785.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. |
2fa70ee
to
d889f90
Compare
f8145d3
to
13fd7d5
Compare
This comment was marked as resolved.
This comment was marked as resolved.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Currently, the field_to_instanceof transformer isn't used. If we decide to keep it, we should yeet its JSON file and make it similar to ReplaceFieldWithGetterAccess
(i.e. having them declared in NeoForgeCoreMod
)
coremods/src/main/java/net/neoforged/neoforge/coremods/package-info.java
Show resolved
Hide resolved
coremods/src/main/java/net/neoforged/neoforge/coremods/ReplaceFieldWithGetterAccess.java
Show resolved
Hide resolved
coremods/src/main/java/net/neoforged/neoforge/coremods/ReplaceFieldWithGetterAccess.java
Show resolved
Hide resolved
coremods/src/main/java/net/neoforged/neoforge/coremods/MethodRedirector.java
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just as a note for future™, we should start generating the finalize spawn targets file.
🚀 This PR has been released as NeoForge version |
Based on neoforged/FancyModLoader#79
This removes the need to load the JS engine if only NF is present, by removing our JS coremods and replacing them with Transformer based Java Coremods instead.
This also bumps JCC since it chokes on the subproject being present on the classpath as folders of classes, rather than jar files.
Coremods:
finalizeSpawn
all around the codebase to our hook class, which emits the corresponding event.stack.getItem() == Items.XYZ
bystack.getItem() instanceof XYZ
allowing mod subclassed items to work with Vanilla logic.this.field
for private fields with use of the corresponding getter, allowing mods that subclass to change what the superclass uses.