LlamaLad7 / MixinExtras

Companion library to SpongePowered Mixin with many custom injectors for a more expressive experience.
MIT License
319 stars 17 forks source link

WrapWithCondition annotation is targeting an instruction with a non-void return type #70

Closed dima-dencep closed 9 months ago

dima-dencep commented 9 months ago

I'm getting an error:

Caused by: org.spongepowered.asm.mixin.injection.throwables.InvalidInjectionException: @WrapWithCondition annotation is targeting an instruction with a non-void return type in net/minecraft/client/MinecraftClient::onResourceReloadFailure(Ljava/lang/Throwable;Lnet/minecraft/text/Text;Lnet/minecraft/client/MinecraftClient$LoadingContext;)V in net/minecraft/client/MinecraftClient::rrls$doubleLoad [INJECT Applicator Phase -> rrls-common.mixins.json:MinecraftClientMixin from mod rrls -> Apply Injections ->  -> Inject -> rrls-common.mixins.json:MinecraftClientMixin from mod rrls->@WrapWithCondition::rrls$doubleLoad(Lnet/minecraft/client/MinecraftClient;ZLnet/minecraft/client/MinecraftClient$LoadingContext;)Z]
    at com.llamalad7.mixinextras.versions.MixinVersionImpl_v0_8_4.makeInvalidInjectionException(MixinVersionImpl_v0_8_4.java:14) ~[mixinextras-fabric-0.3.1.jar:?]

The whole point is that the return value is not used there: image

reloadResources() returns CompletableFuture<Void>

LlamaLad7 commented 9 months ago

Show your mixin.

Geolykt commented 9 months ago

I am not sure what you are going at, after you call reloadResources() you call thenRun on your CF, so you very obviously use your return value.

dima-dencep commented 9 months ago

Show your mixin.

https://github.com/dima-dencep/rrls/blob/1.20.x/dev/common/src/main/java/com/github/dimadencep/mods/rrls/mixins/MinecraftClientMixin.java#L74-L80

LlamaLad7 commented 9 months ago

Yeah no the return value clearly is used.

dima-dencep commented 9 months ago

I am not sure what you are going at, after you call reloadResources() you call thenRun on your CF, so you very obviously use your return value.

I see