diff --git a/src/main/java/org/quiltmc/loader/impl/plugin/quilt/StandardQuiltPlugin.java b/src/main/java/org/quiltmc/loader/impl/plugin/quilt/StandardQuiltPlugin.java index b8b3b6878..46abfd7c3 100644 --- a/src/main/java/org/quiltmc/loader/impl/plugin/quilt/StandardQuiltPlugin.java +++ b/src/main/java/org/quiltmc/loader/impl/plugin/quilt/StandardQuiltPlugin.java @@ -247,6 +247,28 @@ private ModLoadOption[] scan0(Path root, QuiltLoaderIcon fileIcon, ModLocation l if (FasterFiles.exists(qmj5)) { if (QuiltLoader.isDevelopmentEnvironment()) { + if (FasterFiles.exists(qmj)) { + QuiltLoaderText title = QuiltLoaderText.translate("gui.text.qmj_and_qmj5_coexistence.title"); + QuiltDisplayedError error = context().reportError(title); + String describedPath = context().manager().describePath(usedQmj); + error.appendReportText( + "A coexistence of 'quilt.mod.json5' and 'quilt.mod.json' has been detected at " + describedPath, + "These metadata files cannot coexist with each other due to their conflicting purposes!" + ); + error.appendDescription( + QuiltLoaderText.translate("gui.text.qmj_and_qmj5_coexistence.desc.0"), + QuiltLoaderText.translate("gui.text.qmj_and_qmj5_coexistence.desc.1"), + QuiltLoaderText.translate("gui.text.qmj_and_qmj5_coexistence.desc.2", describedPath) + ); + context().manager().getRealContainingFile(root).ifPresent(real -> + error.addFileViewButton(real) + .icon(QuiltLoaderGui.iconJarFile().withDecoration(QuiltLoaderGui.iconQuilt())) + ); + + guiNode.addChild(QuiltLoaderText.translate("gui.text.qmj_and_qmj5_coexistence")); + return null; + } + usedQmj = qmj5; } else { QuiltLoaderText title = QuiltLoaderText.translate("gui.text.qmj5_on_production.title"); diff --git a/src/main/resources/lang/quilt_loader.properties b/src/main/resources/lang/quilt_loader.properties index c59f680d8..fd68c5573 100644 --- a/src/main/resources/lang/quilt_loader.properties +++ b/src/main/resources/lang/quilt_loader.properties @@ -71,6 +71,11 @@ gui.text.qmj5_on_production.title=Attempted to read an unconverted 'quilt.mod.js gui.text.qmj5_on_production.desc.0=An attempt to read a 'quilt.mod.json5' file was detected! gui.text.qmj5_on_production.desc.1='quilt.mod.json5' files can't be used outside a development environment without converting to a 'quilt.mod.json' file! gui.text.qmj5_on_production.desc.2=From %s +gui.text.qmj_and_qmj5_coexistence=Coexistence of conflicting Quilt metadata found +gui.text.qmj_and_qmj5_coexistence.title=Detected the coexistence of conflicting metadata! +gui.text.qmj_and_qmj5_coexistence.desc.0=A coexistence of 'quilt.mod.json5' and 'quilt.mod.json' has been detected. +gui.text.qmj_and_qmj5_coexistence.desc.1=These metadata files cannot coexist with each other due to their conflicting purposes! +gui.text.qmj_and_qmj5_coexistence.desc.2=From %s error.unhandled_solver=Complex solver error; see the crash report for more information error.unhandled_solver.desc=Please try updating quilt-loader to see if an update can describe this.\nOr report this to the quilt-loader project so this can be fixed. error.unhandled_solver.desc.rule_n= \n \nRule %s (%s):