neoforged / MDK

The Mod Developer Kit - this is where you start if you want to develop a new mod
https://github.com/NeoForgeMDKs
179 stars 60 forks source link

Unmodified MDK setup fails to launch due to `Invalid bare key: ${mod_id}` #34

Closed Lance5057 closed 5 months ago

Lance5057 commented 6 months ago

Neoforge - 20.4.47-beta Eclipse

Steps to Reproduce: "Use this Template" Import Gradle Project Manually create runs/client folder https://github.com/neoforged/NeoGradle/issues/78#issue-2044707896 Launch Group -> MDK - Client

Exception in thread "main" com.electronwill.nightconfig.core.io.ParsingException: Invalid bare key: ${mod_id}
    at MC-BOOTSTRAP/com.electronwill.nightconfig.toml@3.6.4/com.electronwill.nightconfig.toml.TableParser.parseKey(TableParser.java:175)
    at MC-BOOTSTRAP/com.electronwill.nightconfig.toml@3.6.4/com.electronwill.nightconfig.toml.TableParser.parseTableName(TableParser.java:111)
    at MC-BOOTSTRAP/com.electronwill.nightconfig.toml@3.6.4/com.electronwill.nightconfig.toml.TomlParser.parse(TomlParser.java:51)
    at MC-BOOTSTRAP/com.electronwill.nightconfig.toml@3.6.4/com.electronwill.nightconfig.toml.TomlParser.parse(TomlParser.java:37)
    at MC-BOOTSTRAP/com.electronwill.nightconfig.core@3.6.4/com.electronwill.nightconfig.core.io.ConfigParser.parse(ConfigParser.java:113)
    at MC-BOOTSTRAP/com.electronwill.nightconfig.core@3.6.4/com.electronwill.nightconfig.core.io.ConfigParser.parse(ConfigParser.java:219)
    at MC-BOOTSTRAP/com.electronwill.nightconfig.core@3.6.4/com.electronwill.nightconfig.core.io.ConfigParser.parse(ConfigParser.java:202)
    at MC-BOOTSTRAP/com.electronwill.nightconfig.core@3.6.4/com.electronwill.nightconfig.core.file.WriteAsyncFileConfig.load(WriteAsyncFileConfig.java:138)
    at MC-BOOTSTRAP/fml_loader@2.0.3/net.neoforged.fml.loading.moddiscovery.ModFileParser.modsTomlParser(ModFileParser.java:44)
    at MC-BOOTSTRAP/fml_loader@2.0.3/net.neoforged.fml.loading.moddiscovery.ModFileParser.readModList(ModFileParser.java:31)
    at MC-BOOTSTRAP/fml_loader@2.0.3/net.neoforged.fml.loading.moddiscovery.ModFile.<init>(ModFile.java:72)
    at MC-BOOTSTRAP/fml_loader@2.0.3/net.neoforged.fml.loading.moddiscovery.ModFile.<init>(ModFile.java:61)
    at MC-BOOTSTRAP/fml_loader@2.0.3/net.neoforged.fml.loading.moddiscovery.AbstractModProvider.createMod(AbstractModProvider.java:48)
    at MC-BOOTSTRAP/fml_loader@2.0.3/net.neoforged.fml.loading.moddiscovery.MinecraftLocator.lambda$scanMods$4(MinecraftLocator.java:51)
    at java.base/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:197)
    at java.base/java.util.AbstractList$RandomAccessSpliterator.forEachRemaining(AbstractList.java:720)
    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.StreamSpliterators$WrappingSpliterator.forEachRemaining(StreamSpliterators.java:310)
    at java.base/java.util.stream.Streams$ConcatSpliterator.forEachRemaining(Streams.java:735)
    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/fml_loader@2.0.3/net.neoforged.fml.loading.moddiscovery.MinecraftLocator.scanMods(MinecraftLocator.java:55)
    at MC-BOOTSTRAP/fml_loader@2.0.3/net.neoforged.fml.loading.moddiscovery.ModDiscoverer.discoverMods(ModDiscoverer.java:75)
    at MC-BOOTSTRAP/fml_loader@2.0.3/net.neoforged.fml.loading.FMLLoader.beginModScan(FMLLoader.java:155)
    at MC-BOOTSTRAP/fml_loader@2.0.3/net.neoforged.fml.loading.FMLServiceProvider.beginScanning(FMLServiceProvider.java:88)
    at MC-BOOTSTRAP/cpw.mods.modlauncher@10.0.9/cpw.mods.modlauncher.TransformationServiceDecorator.runScan(TransformationServiceDecorator.java:112)
    at MC-BOOTSTRAP/cpw.mods.modlauncher@10.0.9/cpw.mods.modlauncher.TransformationServicesHandler.lambda$runScanningTransformationServices$8(TransformationServicesHandler.java:100)
    at java.base/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:197)
    at java.base/java.util.HashMap$ValueSpliterator.forEachRemaining(HashMap.java:1779)
    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/cpw.mods.modlauncher@10.0.9/cpw.mods.modlauncher.TransformationServicesHandler.runScanningTransformationServices(TransformationServicesHandler.java:102)
    at MC-BOOTSTRAP/cpw.mods.modlauncher@10.0.9/cpw.mods.modlauncher.TransformationServicesHandler.initializeTransformationServices(TransformationServicesHandler.java:55)
    at MC-BOOTSTRAP/cpw.mods.modlauncher@10.0.9/cpw.mods.modlauncher.Launcher.run(Launcher.java:88)
    at MC-BOOTSTRAP/cpw.mods.modlauncher@10.0.9/cpw.mods.modlauncher.Launcher.main(Launcher.java:78)
    at MC-BOOTSTRAP/cpw.mods.modlauncher@10.0.9/cpw.mods.modlauncher.BootstrapLaunchConsumer.accept(BootstrapLaunchConsumer.java:26)
    at MC-BOOTSTRAP/cpw.mods.modlauncher@10.0.9/cpw.mods.modlauncher.BootstrapLaunchConsumer.accept(BootstrapLaunchConsumer.java:23)
    at cpw.mods.bootstraplauncher@1.1.2/cpw.mods.bootstraplauncher.BootstrapLauncher.main(BootstrapLauncher.java:141) 

Which is an issue with mods.toml. Minecraft crashes after this.

I haven't edited anything yet so I'm not sure what's wrong.

a-a-GiTHuB-a-a commented 6 months ago

If you check the mods.toml file, it states the field is required. The break is intentional.

If you want the base mod to compile properly, you can fill it with examplemod. Also check settings.gradle.

TelepathicGrunt commented 6 months ago

@a-a-GiTHuB-a-a no, it is not supposed to break. With IntelliJ, that field is properly replaced with the modid specified elsewhere. The issue is Eclipse doesn’t replace the value properly. There’s some work behind the scenes iirc to get eclipse to work again with the MDK out of the box. For now, eclipse users will need to manually add the values to the mods.toml file instead of relying on the substitution that isn’t working for eclipse

a-a-GiTHuB-a-a commented 6 months ago

Huh. VSCode doesn't do that, either, so I assumed it was intentional, though annoying.