Carpet-Fixes

Carpet-Fixes

383k Downloads

Mixin incompatibility with GolfIV

EcoBuilder13 opened this issue ยท 12 comments

commented

Minecraft: 1.17.1
GolfIV: 0.4.0
carpet-fixes: 1.0.1

Both GolfIV and carpet-fixes redirect the same method causing a crash on start up when used together. This mixin should be rewritten to use an Inject so one can be canceled if used together. If this is not possible with an Inject one of the mods can disable the entire mixin class in the mixin.json.

[main/WARN]: @Redirect conflict. Skipping carpetfixes.mixins.json:blockFixes.PistonBlock_bedrockBreakingMixin->@Redirect::removeBlock(Lnet/minecraft/class_1937;Lnet/minecraft/class_2338;Z)Z with priority 1000, already redirected by golfiv.mixins.json:PistonMixin_PreventDestruction->@Redirect::redirectWorld(Lnet/minecraft/class_1937;Lnet/minecraft/class_2338;Z)Z with priority 1000
[main/WARN]: @Redirect conflict. Skipping carpetfixes.mixins.json:blockFixes.PistonBlock_bedrockBreakingMixin->@Redirect::removeBlock(Lnet/minecraft/class_1937;Lnet/minecraft/class_2338;Z)Z with priority 1000, already redirected by golfiv.mixins.json:PistonMixin_PreventDestruction->@Redirect::redirectWorld(Lnet/minecraft/class_1937;Lnet/minecraft/class_2338;Z)Z with priority 1000

This issue has been cross-posted on both repositories so it can be fixed on both sides.

commented

I just isolated everything to a Fabric API + Carpet + Carpet-Fixes + GolfV test eviroment and it still crashes.

[main/WARN]: @Redirect conflict. Skipping golfiv.mixins.json:PistonMixin_PreventDestruction->@Redirect::redirectWorld(Lnet/minecraft/class_1937;Lnet/minecraft/class_2338;Z)Z with priority 1000, already redirected by carpetfixes.mixins.json:blockFixes.PistonBlock_illegalBreakingMixin->@Redirect::removeBlock(Lnet/minecraft/class_1937;Lnet/minecraft/class_2338;Z)Z with priority 1010
[main/WARN]: @Redirect conflict. Skipping golfiv.mixins.json:PistonMixin_PreventDestruction->@Redirect::redirectWorld(Lnet/minecraft/class_1937;Lnet/minecraft/class_2338;Z)Z with priority 1000, already redirected by carpetfixes.mixins.json:blockFixes.PistonBlock_illegalBreakingMixin->@Redirect::removeBlock(Lnet/minecraft/class_1937;Lnet/minecraft/class_2338;Z)Z with priority 1010
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:78)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.base/java.lang.reflect.Method.invoke(Method.java:567)
	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: java.lang.reflect.InvocationTargetException
	at net.fabricmc.loader.game.MinecraftGameProvider.launch(MinecraftGameProvider.java:236)
	at net.fabricmc.loader.launch.knot.Knot.launch(Knot.java:153)
	at net.fabricmc.loader.launch.knot.KnotClient.main(KnotClient.java:28)
	... 8 more
Exiting with -1
Caused by: java.lang.reflect.InvocationTargetException
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:78)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.base/java.lang.reflect.Method.invoke(Method.java:567)
	at net.fabricmc.loader.game.MinecraftGameProvider.launch(MinecraftGameProvider.java:234)
	... 10 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:363)
	at org.spongepowered.asm.mixin.transformer.MixinTransformer.transformClass(MixinTransformer.java:208)
	at org.spongepowered.asm.mixin.transformer.MixinTransformer.transformClassBytes(MixinTransformer.java:178)
	at org.spongepowered.asm.mixin.transformer.FabricMixinTransformerProxy.transformClassBytes(FabricMixinTransformerProxy.java:23)
	at net.fabricmc.loader.launch.knot.KnotClassDelegate.getPostMixinClassByteArray(KnotClassDelegate.java:162)
	at net.fabricmc.loader.launch.knot.KnotClassLoader.loadClass(KnotClassLoader.java:154)
	at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:519)
	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:723)
	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)
	... 15 more
Caused by: org.spongepowered.asm.mixin.injection.throwables.InjectionError: Critical injection failure: Redirector redirectWorld(Lnet/minecraft/class_1937;Lnet/minecraft/class_2338;Z)Z in golfiv.mixins.json:PistonMixin_PreventDestruction failed injection check, (0/1) succeeded. Scanned 1 target(s). Using refmap golfiv-refmap.json
	at org.spongepowered.asm.mixin.injection.struct.InjectionInfo.postInject(InjectionInfo.java:408)
	at org.spongepowered.asm.mixin.transformer.MixinTargetContext.applyInjections(MixinTargetContext.java:1291)
	at org.spongepowered.asm.mixin.transformer.MixinApplicatorStandard.applyInjections(MixinApplicatorStandard.java:1042)
	at org.spongepowered.asm.mixin.transformer.MixinApplicatorStandard.applyMixin(MixinApplicatorStandard.java:395)
	at org.spongepowered.asm.mixin.transformer.MixinApplicatorStandard.apply(MixinApplicatorStandard.java:320)
	at org.spongepowered.asm.mixin.transformer.TargetClassContext.applyMixins(TargetClassContext.java:345)
	at org.spongepowered.asm.mixin.transformer.MixinProcessor.applyMixins(MixinProcessor.java:569)
	at org.spongepowered.asm.mixin.transformer.MixinProcessor.applyMixins(MixinProcessor.java:351)
	... 30 more
Process exited with code 255.
commented

If golf accepts my pull request. It would fix the issue. Not much else I can do apart from that...
samolego/GolfIV#54

commented

You could just disable their mixin entirely if that's the case. Right now it does exactly the same thing does as yours and provides no other functionality. Therefore it shouldn't cause to much of a problem unless if they make any other changes in that mixin.

commented

The problem is that a redirect is kinda required for what I want. Although I can change it. I was going to make it so mine also allows you to choose which blocks to prevent breaking instead of just bedrock

commented

Disabling someone else's code is easier said than done...

commented

Attempting to fix this by raising the priority level of my version. It will yield an error telling you that golf's will no longer work. Although mine will work and it shouldn't crash.
Pls tell me if this fixes your issue: Test Fix

commented

Weird it should not crash if their mixin does not get applied. If it crashes then I will actually modify there mixin myself

commented

I see the message in the log about your mixin having priority 1010 and that GolfV's mixin is being skipped but then it still proceeds to crash because their mixin fails to apply. I will try and see if there is anything that may be intereing as well as try to find where I have seen mixin's disabled by mods before.

commented

Ya like I said, disabling another mod's mixin is not something you should be doing.
Now that the priority between the piston has been fixed, it must be something else that is causing the crash?

commented

The issue has now been fixed. I will be publishing a new version of carpet-fixes soon v1.1.0 with all the new rules & the fixes to this issue ;)

commented

What do you need from GolfIV that carpet-fixes dosen't have?

commented

It fixes exploits that aren't considered bugs. Such as there is a feature to make the server check it's version of onGround for players instead of trusting the client so people can't use anti-fall damage hacks. There are also other features such as removing illegal items (out of bounds enchants, over stacked items. creative only items[only for survival players]) and the option to strip some information from the S2C packets. A full list of the features can be found on the mod's Modrinth page.