Skip to content

Commit

Permalink
Add moddev library dependencies to the runtime classpath to match pro…
Browse files Browse the repository at this point in the history
…duction
  • Loading branch information
Technici4n committed May 25, 2024
1 parent 707f85f commit 35aaa51
Showing 1 changed file with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -248,9 +248,14 @@ public void apply(Project project) {
var localRuntime = configurations.create("neoForgeGeneratedArtifacts", config -> {
config.setCanBeResolved(false);
config.setCanBeConsumed(false);
config.withDependencies(dependencies -> {
dependencies.addLater(minecraftClassesArtifact.map(dependencyFactory::create));
// Technically the Minecraft dependencies do not strictly need to be on the classpath because they are pulled from the legacy class path.
// However, we do it anyway because this matches production environments, and allows launch proxies such as DevLogin to use Minecraft's libraries.
dependencies.addLater(neoForgeModDevLibrariesDependency);
dependencies.add(dependencyFactory.create(RunUtils.DEV_LAUNCH_GAV));
});
});
project.getDependencies().addProvider(localRuntime.getName(), minecraftClassesArtifact);
project.getDependencies().add(localRuntime.getName(), RunUtils.DEV_LAUNCH_GAV);

project.getDependencies().attributesSchema(attributesSchema -> {
attributesSchema.attribute(ATTRIBUTE_DISTRIBUTION).getDisambiguationRules().add(DistributionDisambiguation.class);
Expand Down

0 comments on commit 35aaa51

Please sign in to comment.