Andrew6rant / Stacker

Minecraft mod to change the stack size of all items. Fabric 1.19, 1.18, and 1.17.
Creative Commons Zero v1.0 Universal
26 stars 17 forks source link

Error starting MC 1.17.1 with Stacker 2.1.0: AnvilScreenHandlerMixin from mod stacker failed injection check #22

Closed lospejos closed 2 years ago

lospejos commented 2 years ago

What was done: 1) Using MultiMC, added instance of Another Qualtiy Modpack 2 v 2.10.2 from CurseForge, see https://www.curseforge.com/minecraft/modpacks/another-quality-modpack-2 2) Added stacker mod file (version 2.1.0) to instance mods folder, used file: https://www.curseforge.com/minecraft/mc-mods/stacker/download/3517611 3) When trying to start, I've got error in log file:

Failed to start Minecraft:
java.lang.reflect.InvocationTargetException
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
    at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.base/java.lang.reflect.Method.invoke(Method.java:568)
    at org.multimc.onesix.OneSixLauncher.launchWithMainClass(OneSixLauncher.java:210)
    at org.multimc.onesix.OneSixLauncher.launch(OneSixLauncher.java:245)
    at org.multimc.EntryPoint.listen(EntryPoint.java:143)
    at org.multimc.EntryPoint.main(EntryPoint.java:34)
Caused by: java.lang.RuntimeException: Minecraft has crashed
    at net.fabricmc.loader.impl.game.minecraft.MinecraftGameProvider.launch(MinecraftGameProvider.java:571)
    at net.fabricmc.loader.impl.launch.knot.Knot.launch(Knot.java:74)
    at net.fabricmc.loader.impl.launch.knot.KnotClient.main(KnotClient.java:23)
    ... 8 more
Caused by: java.lang.ExceptionInInitializerError
    at net.minecraft.class_3523.<clinit>(class_3523.java:13)
    at net.minecraft.class_5471.<clinit>(class_5471.java:11)
    at net.minecraft.class_5458.method_30573(class_5458.java:44)
    at net.minecraft.class_5458.method_30566(class_5458.java:75)
    at java.base/java.util.LinkedHashMap.forEach(LinkedHashMap.java:721)
    at net.minecraft.class_5458.<clinit>(class_5458.java:74)
    at net.minecraft.class_2378.<clinit>(class_2378.java:266)
    at net.minecraft.class_2966.method_12851(class_2966.java:44)
    at net.minecraft.client.main.Main.main(Main.java:139)
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
    at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.base/java.lang.reflect.Method.invoke(Method.java:568)
    at net.fabricmc.loader.impl.game.minecraft.MinecraftGameProvider.launch(MinecraftGameProvider.java:568)
    ... 10 more
Caused by: java.lang.RuntimeException: Mixin transformation of net.minecraft.class_1706 failed
    at net.fabricmc.loader.impl.launch.knot.KnotClassDelegate.getPostMixinClassByteArray(KnotClassDelegate.java:224)
    at net.fabricmc.loader.impl.launch.knot.KnotClassDelegate.tryLoadClass(KnotClassDelegate.java:133)
    at net.fabricmc.loader.impl.launch.knot.KnotClassLoader.loadClass(KnotClassLoader.java:155)
    at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:520)
    at net.minecraft.class_2246.<clinit>(class_2246.java:443)
    ... 24 more
Caused by: org.spongepowered.asm.mixin.transformer.throwables.MixinTransformerError: An unexpected critical error was encountered
    at org.spongepowered.asm.mixin.transformer.MixinProcessor.applyMixins(MixinProcessor.java:392)
    at org.spongepowered.asm.mixin.transformer.MixinTransformer.transformClass(MixinTransformer.java:234)
    at org.spongepowered.asm.mixin.transformer.MixinTransformer.transformClassBytes(MixinTransformer.java:202)
    at net.fabricmc.loader.impl.launch.knot.KnotClassDelegate.getPostMixinClassByteArray(KnotClassDelegate.java:222)
    ... 28 more
Caused by: org.spongepowered.asm.mixin.injection.throwables.InjectionError: Critical injection failure: Redirector setDecrementSlot1StackCount(Lnet/minecraft/class_1263;ILnet/minecraft/class_1799;)V in stacker.mixins.json:AnvilScreenHandlerMixin from mod stacker failed injection check, (0/1) succeeded. Scanned 1 target(s). Using refmap stacker-refmap.json
    at org.spongepowered.asm.mixin.injection.struct.InjectionInfo.postInject(InjectionInfo.java:468)
    at org.spongepowered.asm.mixin.transformer.MixinTargetContext.applyInjections(MixinTargetContext.java:1381)
    at org.spongepowered.asm.mixin.transformer.MixinApplicatorStandard.applyInjections(MixinApplicatorStandard.java:1052)
    at org.spongepowered.asm.mixin.transformer.MixinApplicatorStandard.applyMixin(MixinApplicatorStandard.java:400)
    at org.spongepowered.asm.mixin.transformer.MixinApplicatorStandard.apply(MixinApplicatorStandard.java:325)
    at org.spongepowered.asm.mixin.transformer.TargetClassContext.apply(TargetClassContext.java:421)
    at org.spongepowered.asm.mixin.transformer.TargetClassContext.applyMixins(TargetClassContext.java:403)
    at org.spongepowered.asm.mixin.transformer.MixinProcessor.applyMixins(MixinProcessor.java:363)
    ... 31 more
Exiting with -1
Process exited with code -1.

Also in mods folder present fabric-api-0.42.1+1.17 mod. May be this is error is related to Fabric version? Using version 2.0 of this Stacker mod, everything is fine.

Andrew6rant commented 2 years ago

I am not going to be able to test this for the next few days (it is Thanksgiving break), but from this error it looks like the anvil mixin fails to find the proper method. That might be a api version issue, but there is a small chance it is due to a mod conflict as well. (and a chance it is entirely on me) Does this error happen on an instance with just Stacker (and dependencies), using the same fabric api version?

In the meantime before I get this fixed, you can use Stacker version 2.0 (it doesn't have that mixin at all). Just note that 2.1.0 had a lot of fixes, namely:

Also, that modpack has Iron Furnaces in it, there is a duplication glitch when it is combined with Stacker: #15 . This isn't something I can fix on my side, Iron Furnaces simply assumes that max stack size is 64 (which, to be fair, is a reasonable thing to do)

lospejos commented 2 years ago

Thanks for reply!

jigoralpsi commented 2 years ago

FYI: I found its a conflict with the mod Charm, which ALSO modifies that mixin to fix enchanted books on anvils. If you edit the Charm config, specifically setting "StackableEnchantedBooks Enabled" from true to false, BEFORE opening up the game, should let Stacker play nice again with the update. At least, it did for me.