自己做了个ModLoader,在ModLoader中加入了 mixin 0.8.6 的源代码,可以正常进行编译,但是一运行就会报错:
Hello Module Mod Loader! Mod: loading.... 4月 06, 2024 2:47:53 下午 org.ksmcbrigade.Main main 信息: All mods: 4月 06, 2024 2:47:53 下午 org.ksmcbrigade.Main main 信息: ModInfo{file=E:\PCL2\.minecraft\versions\1.18.1\mods\example.jar, main=org.example.Main, info={"main":"org.example.Main","mixin":"mixin.json"}, mixin={}} [14:47:53] [mixin/ERROR] No mixin host service is available. Services: org.spongepowered.asm.service.ServiceNotAvailableError: No mixin host service is available. Services: at org.spongepowered.asm.service.MixinService.initService(MixinService.java:232) at org.spongepowered.asm.service.MixinService.getServiceInstance(MixinService.java:189) at org.spongepowered.asm.service.MixinService.getService(MixinService.java:183) at org.spongepowered.asm.launch.MixinBootstrap.(MixinBootstrap.java:88) at org.ksmcbrigade.Main.main(Main.java:48) Exception in thread "main" org.spongepowered.asm.service.ServiceNotAvailableError: No mixin host service is available. Services: at org.spongepowered.asm.service.MixinService.initService(MixinService.java:232) at org.spongepowered.asm.service.MixinService.getServiceInstance(MixinService.java:189) at org.spongepowered.asm.service.MixinService.getService(MixinService.java:183) at org.spongepowered.asm.launch.MixinBootstrap.(MixinBootstrap.java:88) at org.ksmcbrigade.Main.main(Main.java:48)
ModLoader会在获取到所有模组之后进行有关mixin操作:
- System.<i>setProperty</i>(<font color="#6a8759">"mixin.service"</font><font color="#cc7832">, </font>Service.<font color="#cc7832">class</font>.getName())<font color="#cc7832">;
- </font>MixinBootstrap.<i>init</i>()<font color="#cc7832">;</font>
复制代码
ModLoader Github 链接:yiyuyan/ModuleModLoader (github.com)
|