-
-
Notifications
You must be signed in to change notification settings - Fork 6
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
Legacy plugin for 1.17 to 1.20.1 #118
base: main
Are you sure you want to change the base?
Conversation
Last commit published: 39bb3eb0a6295626809482051fe08631d45c216b. 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 #118' // https://github.com/neoforged/ModDevGradle/pull/118
url 'https://prmaven.neoforged.net/ModDevGradle/pr118'
content {
includeModule('net.neoforged.moddev.legacy', 'net.neoforged.moddev.legacy.gradle.plugin')
includeModule('net.neoforged.moddev', 'net.neoforged.moddev.gradle.plugin')
includeModule('net.neoforged', 'moddev-gradle')
includeModule('net.neoforged.moddev.repositories', 'net.neoforged.moddev.repositories.gradle.plugin')
}
}
} |
@shartte, this pull request has conflicts, please resolve them for this PR to move forward. |
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.
Not too bad. However, it is clear that this can only work as long as keep the toolchain essentially the same. When we will remove the legacy CP, this legacy plugin will go out of the window. This is also why I don't see this ever supporting 1.16. This raises the question of whether the plugin should exist in the same branch or not.
@@ -1,6 +1,6 @@ | |||
distributionBase=GRADLE_USER_HOME | |||
distributionPath=wrapper/dists | |||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.9-all.zip | |||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.10-bin.zip |
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.
distributionUrl=https\://services.gradle.org/distributions/gradle-8.10-bin.zip | |
distributionUrl=https\://services.gradle.org/distributions/gradle-8.10-all.zip |
We are writing a plugin, I want the sources.
repositories { | ||
mavenLocal() | ||
maven { | ||
name 'cursemaven' | ||
url 'https://cursemaven.com' | ||
content { | ||
includeGroup "curse.maven" | ||
} | ||
} | ||
} |
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.
Remove unused mavens. (Before merging)
|
||
dependencies { | ||
modCompileOnly('mezz.jei:jei-1.20.1-forge:15.17.0.76') { | ||
transitive = false |
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.
Why?
dependencies { | ||
modCompileOnly('mezz.jei:jei-1.20.1-forge:15.17.0.76') { | ||
transitive = false | ||
} | ||
modRuntimeOnly('curse.maven:mekanism-268560:5662583') | ||
modImplementation('curse.maven:applied-energistics-2-223794:5641282') | ||
} |
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.
Do we really want to have these deps in repo? 😅
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.
For a test project of an old MC version, why not
My only concern is these mavens going down tbh
The artifacts aren't going to change so we will never update these again
import javax.inject.Inject; | ||
import java.util.List; | ||
|
||
public abstract class MixinExtension { |
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.
We should move all extensions to a root extension. For example neoForgeLegacy
.
@@ -244,7 +257,7 @@ public static ModFoldersProvider getIdeaModFoldersProvider(Project project, | |||
folders = getModFoldersForGradle(project, modsProvider, includeUnitTests); | |||
} | |||
|
|||
var modFoldersProvider = project.getObjects().newInstance(ModFoldersProvider.class); | |||
var modFoldersProvider = project.getObjects().newInstance(ModFoldersProvider.class, project); |
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.
Unnecessary.
@@ -395,24 +408,29 @@ record AssetProperties(String assetIndex, String assetsRoot) { | |||
|
|||
abstract class ModFoldersProvider implements CommandLineArgumentProvider { | |||
@Inject | |||
public ModFoldersProvider() { | |||
public ModFoldersProvider(Project project) { | |||
getClassesArgument().set(project.provider(() -> { |
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.
You don't need the ugly provider call. You can use getModFolders().map(...)
.
|
||
public record UserDevConfig(String mcp, String sources, String universal, List<String> libraries, List<String> modules, | ||
Map<String, UserDevRunType> runs) implements Serializable { | ||
public static UserDevConfig from(File userDevFile) { | ||
// For backwards compatibility reasons we also support loading this from the userdev jar |
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.
I don't like this at all, it's such a hack.
@@ -0,0 +1,8 @@ | |||
|
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.
not working (yet)?
RunUtils.escapeJvmArg(RunUtils.getEclipseModFoldersProvider(project, run.getMods(), false).getArgument()) | ||
) | ||
.args(RunUtils.escapeJvmArg(RunUtils.getArgFileParameter(prepareTask.getProgramArgsFile().get()))) | ||
.envVar(run.getEnvironment().get()) | ||
.envVar(RunUtils.replaceModClassesEnv(run, () -> RunUtils.getEclipseModFoldersProvider(project, run.getMods(), false))) |
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.
Not to mention that this sets both MOD_CLASSES
and --fml.modFolders
.
@shartte, this pull request has conflicts, please resolve them for this PR to move forward. |
55c7be9
to
102b7bf
Compare
@shartte, this pull request has conflicts, please resolve them for this PR to move forward. |
Co-authored-by: Matyrobbrt <[email protected]>
|
||
@Override | ||
public void registerItemSubtypes(ISubtypeRegistration registration) { | ||
registration.registerSubtypeInterpreter(Items.ALLIUM, (ingredient, context) -> "allium"); |
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.
We might want to comment here that calling this method tests the remapping of the JEI artifact since this method call would otherwise fail to compile because of the Item argument
|
||
import javax.inject.Inject; | ||
|
||
// @CacheableTransform |
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.
Re enable before merge
@shartte, this pull request has conflicts, please resolve them for this PR to move forward. |
I have been using this for a while and the only issue I found was with this setup when using a version of GregTech when it was built when they were still using ArchLoom. https://github.com/pietro-lopes/mdg-legacy-pr118 Clone repo and run each of the 3 available runs: 1 failing, 2 working. I noticed that their metadata.json lacks the info about if the jarjar is obfuscated or not, but I don't know if that alone is enough. Edit: Can confirm that editing metadata.json takes no effect. |
Adds a separate
net.neoforged.moddev.legacy
plugin that lives in a different sourceset and can be used to develop for Minecraft and Forge 1.17 to 1.20.1.