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

Specifing any value for the key "services" in (neoforge.)mods.toml always causes crash. #125

Open
heipiao233 opened this issue May 3, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@heipiao233
Copy link

The key services in (neoforge.)mods.toml was introduced in MinecraftForge 37.0.0, the 1.17.1 update. It uses a new class ModJarMetadata to implement this by using ModuleDescriptor.Builder.uses.
However, the Builder was created by newAutomaticModule, which doesn't allow calling uses:

   public ModuleDescriptor$Builder uses(String service) {
      if (this.automatic) {
         throw new IllegalStateException("Automatic modules can not declare service dependences");
      } else if (this.uses.contains(Checks.requireServiceTypeName(service))) {
         throw new IllegalStateException("Dependence upon service " + service + " already declared");
      } else {
         this.uses.add(service);
         return this;
      }
   }

(Taken from decompiled OpenJDK 21 (using FernFlower decompiler), but it's same for OpenJDK 16/17.)

This key is documented, and is still not removed in Fancy Mod Loader 3.0.19.

An example that "supports" from MinecraftForge 37.x.x to NeoForge 20.6.20-beta (or later), please gunzip it.

@Technici4n
Copy link
Member

That's quite funny. We should probably remove that key.

@sciwhiz12 sciwhiz12 added the bug Something isn't working label May 3, 2024
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

No branches or pull requests

3 participants