george8188625 / Create-Diesel-Generators

Source code of Create Diesel Generators mod
https://www.curseforge.com/minecraft/mc-mods/create-diesel-generators
MIT License
22 stars 36 forks source link

CC:C Bridge incompatibility/crash #45

Closed c0gd1s closed 12 months ago

c0gd1s commented 1 year ago

The mod causes a startup crash when loaded in conjunction with CC:C Bridge, works fine otherwise with 440 mods. Just posting here to tell both mod authors. https://gist.github.com/c0gd1s/50fbbee0ca129d87609fad8562731012

george8188625 commented 12 months ago

I have a feeling that's not even an issue with C:CC Bridge

  1. There is no crash for me
  2. C:CC Bridge doesn't even use mixins
c0gd1s commented 12 months ago

The crash happens with version 1.20.1, I was able to reproduce the crash 5 times in a row on launch with a clean instance using only your mod, their mod, and the 2 required dependencies (Create and CC Tweaked.) Exact same crash in a clean log as there is in the log with other mods. This crash does not happen with your mod in combination with the other 400+ mods after hundreds of launches.

Relaunching the instance worked correctly and loaded both mods about 10 times in a row, before crashing on the 11th with the same fatal error. Then goes back and forth between launching successfully and crashing. So if you want to recreate the crash you may need to relaunch the instance multiple times.

Someone else also reported the same issue to the Bridge dev, so it's clear the issue is only between these 2 mods.

I have no idea what's going on to cause it, just reporting that a problem exists and that these 2 mods are currently incompatible in 1.20.1

[15:40:33] [pool-4-thread-1/FATAL]: Mixin apply failed createdieselgenerators.mixins.json:ItemEntityMixin -> net.minecraft.world.entity.item.ItemEntity: org.spongepowered.asm.mixin.injection.throwables.InvalidInjectionException Critical injection failure: @Inject annotation on tick could not find any targets matching 'tick()V' in net.minecraft.world.entity.item.ItemEntity. Using refmap mixin.refmap.json [PREINJECT Applicator Phase -> createdieselgenerators.mixins.json:ItemEntityMixin -> Prepare Injections -> -> handler$zcd000$tick(Lorg/spongepowered/asm/mixin/injection/callback/CallbackInfo;)V -> Parse] org.spongepowered.asm.mixin.injection.throwables.InvalidInjectionException: Critical injection failure: @Inject annotation on tick could not find any targets matching 'tick()V' in net.minecraft.world.entity.item.ItemEntity. Using refmap mixin.refmap.json [PREINJECT Applicator Phase -> createdieselgenerators.mixins.json:ItemEntityMixin -> Prepare Injections -> -> handler$zcd000$tick(Lorg/spongepowered/asm/mixin/injection/callback/CallbackInfo;)V -> Parse] at org.spongepowered.asm.mixin.injection.struct.InjectionInfo.validateTargets(InjectionInfo.java:656) ~[mixin-0.8.5.jar:0.8.5+Jenkins-b310.git-155314e6e91465dad727e621a569906a410cd6f4] at org.spongepowered.asm.mixin.injection.struct.InjectionInfo.findTargets(InjectionInfo.java:587) ~[mixin-0.8.5.jar:0.8.5+Jenkins-b310.git-155314e6e91465dad727e621a569906a410cd6f4] at org.spongepowered.asm.mixin.injection.struct.InjectionInfo.readAnnotation(InjectionInfo.java:330) ~[mixin-0.8.5.jar:0.8.5+Jenkins-b310.git-155314e6e91465dad727e621a569906a410cd6f4] at org.spongepowered.asm.mixin.injection.struct.InjectionInfo.(InjectionInfo.java:316) ~[mixin-0.8.5.jar:0.8.5+Jenkins-b310.git-155314e6e91465dad727e621a569906a410cd6f4] at org.spongepowered.asm.mixin.injection.struct.InjectionInfo.(InjectionInfo.java:308) ~[mixin-0.8.5.jar:0.8.5+Jenkins-b310.git-155314e6e91465dad727e621a569906a410cd6f4] at org.spongepowered.asm.mixin.injection.struct.CallbackInjectionInfo.(CallbackInjectionInfo.java:46) ~[mixin-0.8.5.jar:0.8.5+Jenkins-b310.git-155314e6e91465dad727e621a569906a410cd6f4] at jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) ~[?:?] at jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:77) ~[?:?] at jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) ~[?:?] at java.lang.reflect.Constructor.newInstanceWithCaller(Constructor.java:499) ~[?:?] at java.lang.reflect.Constructor.newInstance(Constructor.java:480) ~[?:?] at org.spongepowered.asm.mixin.injection.struct.InjectionInfo$InjectorEntry.create(InjectionInfo.java:149) ~[mixin-0.8.5.jar:0.8.5+Jenkins-b310.git-155314e6e91465dad727e621a569906a410cd6f4] at org.spongepowered.asm.mixin.injection.struct.InjectionInfo.parse(InjectionInfo.java:708) ~[mixin-0.8.5.jar:0.8.5+Jenkins-b310.git-155314e6e91465dad727e621a569906a410cd6f4] at org.spongepowered.asm.mixin.transformer.MixinTargetContext.prepareInjections(MixinTargetContext.java:1311) ~[mixin-0.8.5.jar:0.8.5+Jenkins-b310.git-155314e6e91465dad727e621a569906a410cd6f4] at org.spongepowered.asm.mixin.transformer.MixinApplicatorStandard.prepareInjections(MixinApplicatorStandard.java:1042) ~[mixin-0.8.5.jar:0.8.5+Jenkins-b310.git-155314e6e91465dad727e621a569906a410cd6f4] at org.spongepowered.asm.mixin.transformer.MixinApplicatorStandard.applyMixin(MixinApplicatorStandard.java:393) ~[mixin-0.8.5.jar:0.8.5+Jenkins-b310.git-155314e6e91465dad727e621a569906a410cd6f4] at org.spongepowered.asm.mixin.transformer.MixinApplicatorStandard.apply(MixinApplicatorStandard.java:325) ~[mixin-0.8.5.jar:0.8.5+Jenkins-b310.git-155314e6e91465dad727e621a569906a410cd6f4] at org.spongepowered.asm.mixin.transformer.TargetClassContext.apply(TargetClassContext.java:383) ~[mixin-0.8.5.jar:0.8.5+Jenkins-b310.git-155314e6e91465dad727e621a569906a410cd6f4] at org.spongepowered.asm.mixin.transformer.TargetClassContext.applyMixins(TargetClassContext.java:365) ~[mixin-0.8.5.jar:0.8.5+Jenkins-b310.git-155314e6e91465dad727e621a569906a410cd6f4] at org.spongepowered.asm.mixin.transformer.MixinProcessor.applyMixins(MixinProcessor.java:363) ~[mixin-0.8.5.jar:0.8.5+Jenkins-b310.git-155314e6e91465dad727e621a569906a410cd6f4] at org.spongepowered.asm.mixin.transformer.MixinTransformer.transformClass(MixinTransformer.java:250) ~[mixin-0.8.5.jar:0.8.5+Jenkins-b310.git-155314e6e91465dad727e621a569906a410cd6f4] at org.spongepowered.asm.service.modlauncher.MixinTransformationHandler.processClass(MixinTransformationHandler.java:131) ~[mixin-0.8.5.jar:0.8.5+Jenkins-b310.git-155314e6e91465dad727e621a569906a410cd6f4] at org.spongepowered.asm.launch.MixinLaunchPluginLegacy.processClass(MixinLaunchPluginLegacy.java:131) ~[mixin-0.8.5.jar:0.8.5+Jenkins-b310.git-155314e6e91465dad727e621a569906a410cd6f4] at cpw.mods.modlauncher.serviceapi.ILaunchPluginService.processClassWithFlags(ILaunchPluginService.java:156) ~[modlauncher-10.0.9.jar:10.0.9+10.0.9+main.dcd20f30] at cpw.mods.modlauncher.LaunchPluginHandler.offerClassNodeToPlugins(LaunchPluginHandler.java:88) ~[modlauncher-10.0.9.jar:?] at cpw.mods.modlauncher.ClassTransformer.transform(ClassTransformer.java:120) ~[modlauncher-10.0.9.jar:?] at cpw.mods.modlauncher.TransformingClassLoader.maybeTransformClassBytes(TransformingClassLoader.java:50) ~[modlauncher-10.0.9.jar:?] at cpw.mods.cl.ModuleClassLoader.readerToClass(ModuleClassLoader.java:113) ~[securejarhandler-2.1.10.jar:?] at cpw.mods.cl.ModuleClassLoader.lambda$findClass$15(ModuleClassLoader.java:219) ~[securejarhandler-2.1.10.jar:?] at cpw.mods.cl.ModuleClassLoader.loadFromModule(ModuleClassLoader.java:229) ~[securejarhandler-2.1.10.jar:?] at cpw.mods.cl.ModuleClassLoader.findClass(ModuleClassLoader.java:219) ~[securejarhandler-2.1.10.jar:?] at cpw.mods.cl.ModuleClassLoader.loadClass(ModuleClassLoader.java:135) ~[securejarhandler-2.1.10.jar:?] at java.lang.ClassLoader.loadClass(ClassLoader.java:525) ~[?:?] at net.minecraftforge.registries.GameData.init(GameData.java:103) ~[forge-1.20.1-47.2.0-universal.jar%23169!/:?] at net.minecraftforge.registries.GameData.(GameData.java:88) ~[forge-1.20.1-47.2.0-universal.jar%23169!/:?] at net.minecraft.core.registries.BuiltInRegistries.forge(BuiltInRegistries.java:429) ~[client-1.20.1-20230612.114412-srg.jar%23164!/:?] at net.minecraft.core.registries.BuiltInRegistries.forge(BuiltInRegistries.java:409) ~[client-1.20.1-20230612.114412-srg.jar%23164!/:?] at net.minecraft.core.registries.BuiltInRegistries.(BuiltInRegistries.java:121) ~[client-1.20.1-20230612.114412-srg.jar%23164!/:?] at net.minecraft.server.Bootstrap.m135870(Bootstrap.java:43) ~[client-1.20.1-20230612.114412-srg.jar%23164!/:?] at net.minecraft.client.main.Main.lambda$main$0(Main.java:151) ~[client-1.20.1-20230612.114412-srg.jar%23164!/:?] at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:539) ~[?:?] at java.util.concurrent.FutureTask.run(FutureTask.java:264) ~[?:?] at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136) ~[?:?] at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635) ~[?:?] at java.lang.Thread.run(Thread.java:833) ~[?:?]

gmhs022 commented 12 months ago

Okay, I've tried this myself and have no idea what the hell is with this error. I updated to the latest forge and it worked once, trying to re-launch the instance led to it once again repeatedly crashing. Cycling out one of the mods then works to get it running, but then the next attempt also crashes it once again. Removing either mod stops this issue, so it's clearly not just C:DG, and so far C:CCB is the only addon that causes this problem.

gmhs022 commented 12 months ago

The issue seems to be that occasionally the mixin fails to find the targeted "tick()V" method, as seen in ItemEntityMixin.java. Why this sometimes happens I don't know, nor am I knowledgeable enough in Minecraft modding to know what it's all referring to. I did notice that despite what's been said, CCC does contain a mixin, but it's completely unrelated.

george8188625 commented 12 months ago

The problem is not with C:CC bridge, the issue seems to only be on 1.20.1 from the report I have received, The fact that it randomly crashes to some people about an error that is so weird I mean how can be the ItemEntity class missing the tick() method. Maybe if I make the mixin in the Entity class it will work

george8188625 commented 12 months ago

If you wanna use the mod then I modified the jar file to remove the mixin here