Skip to content

MixinExtras @Local Annotation cannot receive local varibles in Early Mixin #42

@kuzuanpa

Description

@kuzuanpa

Minecraft ver: 1.7.10

I didn't use GTNH's gradle system. And I write a custom CoreMod implementing IFMLLoadingPlugin,IEarlyMixinLoader to achieve same effect.

And mixin class:

@Mixin(FontRenderer.class)

public class MixinUnicodeFontShadow {

    @ModifyConstant(method = "renderStringAtPos", constant = @Constant(floatValue = 1.0F))

    private float TFCMixin$fixShadowDistance(float constant, @Local(ordinal = 1) int j){

        return j==-1?0.5F:1.0F;

    }

}

And Exception:

java.lang.VerifyError: Bad local variable type
Exception Details:
  Location:
    net/minecraft/client/gui/FontRenderer.constant$bge000$TFCMixin$fixShadowDistance$mixinextras$bridge$44(F)F @2: aload_2
  Reason:
    Type top (current frame, locals[2]) is not assignable to reference type
  Current Frame:
    bci: @2
    flags: { }
    locals: { 'net/minecraft/client/gui/FontRenderer', float }
    stack: { 'net/minecraft/client/gui/FontRenderer', float }
  Bytecode:
    0x0000000: 2a23 2cb9 02b1 0100 b702 b3ae

I Guess MixinExtras didn't add the @Local variable when invokeing my method
Correct method invoke should looks like this => TFCMixin$fixShadowDistance$mixinextras...(constant, j);
but it is => TFCMixin$fixShadowDistance$mixinextras...(constant);

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions