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

Issues using multi mod setup with eclipse #162

Closed
CreativeMD opened this issue May 2, 2024 · 3 comments · Fixed by #167
Closed

Issues using multi mod setup with eclipse #162

CreativeMD opened this issue May 2, 2024 · 3 comments · Fixed by #167
Labels
bug Something isn't working

Comments

@CreativeMD
Copy link

CreativeMD commented May 2, 2024

Hey there,
I'm having some difficulties setting up my multi-mod workspace in 1.20.6. For some reason the neoforge jar dependency is added twice for each project causing a couple of issues inside eclipse but also when running the game giving the following error:

Exception in thread "main" net.neoforged.fml.ModLoadingException: Loading errors encountered: [
	fml.modloading.multiple_copies_on_classpath
]
	at MC-BOOTSTRAP/[email protected]/net.neoforged.fml.util.DevEnvUtils.findFileSystemRootOfFileOnClasspath(DevEnvUtils.java:78)
	at MC-BOOTSTRAP/[email protected]/net.neoforged.fml.loading.targets.CommonUserdevLaunchHandler.collectAdditionalModFileLocators(CommonUserdevLaunchHandler.java:24)
	at MC-BOOTSTRAP/[email protected]/net.neoforged.fml.loading.FMLLoader.beginModScan(FMLLoader.java:131)
	at MC-BOOTSTRAP/[email protected]/net.neoforged.fml.loading.FMLServiceProvider.beginScanning(FMLServiceProvider.java:76)
	at MC-BOOTSTRAP/[email protected]/cpw.mods.modlauncher.TransformationServiceDecorator.runScan(TransformationServiceDecorator.java:95)
	at MC-BOOTSTRAP/[email protected]/cpw.mods.modlauncher.TransformationServicesHandler.lambda$runScanningTransformationServices$7(TransformationServicesHandler.java:94)
	at java.base/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:197)
	at java.base/java.util.HashMap$ValueSpliterator.forEachRemaining(HashMap.java:1787)
	at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:509)
	at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:499)
	at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:575)
	at java.base/java.util.stream.AbstractPipeline.evaluateToArrayNode(AbstractPipeline.java:260)
	at java.base/java.util.stream.ReferencePipeline.toArray(ReferencePipeline.java:616)
	at java.base/java.util.stream.ReferencePipeline.toArray(ReferencePipeline.java:622)
	at java.base/java.util.stream.ReferencePipeline.toList(ReferencePipeline.java:627)
	at MC-BOOTSTRAP/[email protected]/cpw.mods.modlauncher.TransformationServicesHandler.runScanningTransformationServices(TransformationServicesHandler.java:96)
	at MC-BOOTSTRAP/[email protected]/cpw.mods.modlauncher.TransformationServicesHandler.initializeTransformationServices(TransformationServicesHandler.java:50)
	at MC-BOOTSTRAP/[email protected]/cpw.mods.modlauncher.Launcher.run(Launcher.java:84)
	at MC-BOOTSTRAP/[email protected]/cpw.mods.modlauncher.Launcher.main(Launcher.java:74)
	at MC-BOOTSTRAP/[email protected]/cpw.mods.modlauncher.BootstrapLaunchConsumer.accept(BootstrapLaunchConsumer.java:26)
	at MC-BOOTSTRAP/[email protected]/cpw.mods.modlauncher.BootstrapLaunchConsumer.accept(BootstrapLaunchConsumer.java:23)
	at [email protected]/cpw.mods.bootstraplauncher.BootstrapLauncher.run(BootstrapLauncher.java:176)
	at [email protected]/cpw.mods.bootstraplauncher.BootstrapLauncher.main(BootstrapLauncher.java:65)

When viewing the projects 'Build Path', this dependency can be found twice:
image

My setup can be found here: https://github.com/CreativeMD/ForgeMods/tree/1.20.5

@Technici4n
Copy link
Member

This FML rework exposed a flaw in how NeoGradle handles multiple projects in general. The current workaround for this issue is to make sure that the ng_dummy_ng dependency does not leak outside of your Gradle project.

Instead of adding it to implementation, you should be able to add it to both compileOnly and localRuntime:

// Sets up a dependency configuration called 'localRuntime'.
// This configuration should be used instead of 'runtimeOnly' to declare
// a dependency that will be present for runtime testing but that is
// "optional", meaning it will not be pulled by dependents of this mod.
configurations {
    runtimeClasspath.extendsFrom localRuntime
}

dependencies {
    compileOnly "net.neoforged.neoforge:neoforge:XXX"
    localRuntime "net.neoforged.neoforge:neoforge:XXX"
}

I haven't tested this but there is a good chance that it will solve the issue.

@CreativeMD
Copy link
Author

That fixed it! Thank you so much! Should I leave this issue open till this is properly fixed or should I close it?

@shartte
Copy link
Contributor

shartte commented May 3, 2024

That fixed it! Thank you so much! Should I leave this issue open till this is properly fixed or should I close it?

Please leave it open for now, we're looking into the details behind this problem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants