1.19.1 mods with @Mod annotation on object not loading anymore
bdew opened this issue ยท 2 comments
Getting this on all my mods that have @mod annotation on an object. Changing them to a class works correctly.
It looks like the scan in ScalaLanguageProvider finds the annotation twice with and without the $ and when it can't get the constructor on one of them it crashes.
[21:36:49] [modloading-worker-0/ERROR] [co.ko.sc.ScalaModContainer/LOADING]: Failed to create/get mod instance. ModID: factorium, class net.bdew.factorium.Factorium
java.lang.NoSuchMethodException: net.bdew.factorium.Factorium.<init>()
at java.lang.Class.getConstructor0(Class.java:3585) ~[?:?] {}
at java.lang.Class.getDeclaredConstructor(Class.java:2754) ~[?:?] {}
at com.kotori316.scala_lib.ScalaModContainer.constructMod(ScalaModContainer.java:82) ~[scalablecatsforce-2.13.8-build-6-with-library.jar%23194!/:2.13.8-build-6] {}
at net.minecraftforge.fml.ModContainer.lambda$buildTransitionHandler$10(ModContainer.java:121) ~[fmlcore-1.19.1-42.0.2.jar%23187!/:?] {}
at java.util.concurrent.CompletableFuture$AsyncRun.run$$$capture(CompletableFuture.java:1804) [?:?] {}
at java.util.concurrent.CompletableFuture$AsyncRun.run(CompletableFuture.java) [?:?] {}
at java.util.concurrent.CompletableFuture$AsyncRun.exec(CompletableFuture.java:1796) [?:?] {}
at java.util.concurrent.ForkJoinTask.doExec$$$capture(ForkJoinTask.java:373) [?:?] {}
at java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java) [?:?] {}
at java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec(ForkJoinPool.java:1182) [?:?] {}
at java.util.concurrent.ForkJoinPool.scan(ForkJoinPool.java:1655) [?:?] {}
at java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1622) [?:?] {}
at java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:165) [?:?] {}
I used a wrong filter to separate classes and objects, then classes were loaded instead of objects. The test case was also incorrect.