diff --git a/src/ap/java/org/spongepowered/tools/obfuscation/AnnotatedMixin.java b/src/ap/java/org/spongepowered/tools/obfuscation/AnnotatedMixin.java index 95ffe85d..5f9dae2f 100644 --- a/src/ap/java/org/spongepowered/tools/obfuscation/AnnotatedMixin.java +++ b/src/ap/java/org/spongepowered/tools/obfuscation/AnnotatedMixin.java @@ -415,6 +415,10 @@ class AnnotatedMixin { * Register a {@link org.spongepowered.asm.mixin.injection.At} annotation and process the references */ public void registerInjectionPoint(Element element, AnnotationMirror inject, AnnotationMirror at) { + if (!AnnotatedMixins.getRemapValue(at)) { + return; + } + String type = MirrorUtils.getAnnotationValue(at, "value"); String target = MirrorUtils.getAnnotationValue(at, "target"); this.remapReference(type + ".", target, element, inject, at); diff --git a/src/main/java/org/spongepowered/asm/mixin/injection/At.java b/src/main/java/org/spongepowered/asm/mixin/injection/At.java index a1144020..a0e9763a 100644 --- a/src/main/java/org/spongepowered/asm/mixin/injection/At.java +++ b/src/main/java/org/spongepowered/asm/mixin/injection/At.java @@ -102,6 +102,15 @@ public @interface At { * Target opcode for FIELD and JUMP InjectionPoints. See the javadoc for the relevant injection point for more details. */ public int opcode() default -1; + + /** + * By default, the annotation processor will attempt to locate an obfuscation mapping for the {@link #target} member and any other {@link #args} + * known to contain potentially obfuscated references, since it is anticipated that in general the target of an {@link At} annotation will be an + * obfuscated method or field. However since it is also possible that the target is a non-obfuscated reference it may be necessary to suppress the + * compiler error which would otherwise be generated. Setting this value to false will cause the annotation processor to skip this + * annotation when attempting to build the obfuscation table for the mixin. + */ + public boolean remap() default true; }