Skip to content

Latest commit

 

History

History
24 lines (19 loc) · 572 Bytes

shadow-final.md

File metadata and controls

24 lines (19 loc) · 572 Bytes

@Shadow, final

<- Return

Allows accessing a field or method from the the target class only inside the mixin class. @Final specifies that the shadowed field is final. @Mutable removes the final status from the final field. It is necessary to note that you should not mark these fields with the final modifier.

Example mixin:

@Mixin(Dummy.class)
public class MixinDummy {
	@Final
	@Mutable
	@Shadow
	private int dummyField;
}

Usage:

  public void myInjector(CallbackInfo info) {
      this.dummyField = newValue;
  }