MinecraftDev icon indicating copy to clipboard operation
MinecraftDev copied to clipboard

Unable to find multi-injection target

Open Earthcomputer opened this issue 10 months ago • 0 comments

Minecraft Development for IntelliJ plugin version

2024.3-1.8.2-539

IntelliJ version

IU-243.24978.46

Operating System

Linux

Target platform

Mixins

Description of the bug

In the Mixin

    @Definition(
            id = "sprites",
            field = "Lnet/minecraft/client/render/block/FluidRenderer;lavaSprites:[Lnet/minecraft/client/texture/Sprite;"
    )
    @Expression({"sprites[0]", "sprites[1]"})
    @ModifyExpressionValue(
            method = "render",
            at = @At("MIXINEXTRAS:EXPRESSION")
    )
    public void modifyStillLavaSprite() {

    }

An exception is thrown:

java.lang.AssertionError: Context element (2702,2714): 'PsiLiteralExpression:"sprites[1]"' (class com.intellij.psi.impl.source.tree.java.PsiLiteralExpressionImpl);  must be the parent of at least one of injection hosts.

I think it has to do with there being multiple expressions maybe?

Earthcomputer avatar Mar 02 '25 13:03 Earthcomputer