diff --git a/src/ap/java/org/spongepowered/tools/obfuscation/AnnotatedMixinElementHandlerInjector.java b/src/ap/java/org/spongepowered/tools/obfuscation/AnnotatedMixinElementHandlerInjector.java index d6c7ce4b..b9aed84a 100644 --- a/src/ap/java/org/spongepowered/tools/obfuscation/AnnotatedMixinElementHandlerInjector.java +++ b/src/ap/java/org/spongepowered/tools/obfuscation/AnnotatedMixinElementHandlerInjector.java @@ -95,6 +95,10 @@ class AnnotatedMixinElementHandlerInjector extends AnnotatedMixinElementHandler this.state = state; } + public boolean shouldRemap() { + return this.at.getBoolean("remap", this.state.shouldRemap()); + } + public AnnotationHandle getAt() { return this.at; } @@ -121,6 +125,7 @@ class AnnotatedMixinElementHandlerInjector extends AnnotatedMixinElementHandler public void notifyRemapped() { this.state.notifyRemapped(); } + } AnnotatedMixinElementHandlerInjector(IMixinAnnotationProcessor ap, AnnotatedMixin mixin) { @@ -211,7 +216,7 @@ class AnnotatedMixinElementHandlerInjector extends AnnotatedMixinElementHandler this.ap.printMessage(Kind.ERROR, "Injector in interface is unsupported", elem.getElement()); } - if (!elem.getAt().getBoolean("remap", true)) { + if (!elem.shouldRemap()) { return; } diff --git a/src/ap/java/org/spongepowered/tools/obfuscation/AnnotatedMixins.java b/src/ap/java/org/spongepowered/tools/obfuscation/AnnotatedMixins.java index 3cbbae7b..fb8a4c3a 100644 --- a/src/ap/java/org/spongepowered/tools/obfuscation/AnnotatedMixins.java +++ b/src/ap/java/org/spongepowered/tools/obfuscation/AnnotatedMixins.java @@ -483,7 +483,7 @@ final class AnnotatedMixins implements IMixinAnnotationProcessor, ITokenProvider } private boolean shouldRemap(AnnotatedMixin mixinClass, AnnotationHandle annotation) { - return mixinClass.remap() && annotation.getBoolean("remap", true); + return annotation.getBoolean("remap", mixinClass.remap()); } /** diff --git a/src/main/java/org/spongepowered/asm/mixin/Mixin.java b/src/main/java/org/spongepowered/asm/mixin/Mixin.java index 26e7d694..3d490711 100644 --- a/src/main/java/org/spongepowered/asm/mixin/Mixin.java +++ b/src/main/java/org/spongepowered/asm/mixin/Mixin.java @@ -77,10 +77,11 @@ public @interface Mixin { * false on the individual annotations, or disabled for the entire * mixin by setting the value here to false. Doing so will cause * the annotation processor to skip all annotations in this mixin when - * building the obfuscation table. + * building the obfuscation table unless the individual annotation is + * explicitly decorated with remap = true. * * @return True to instruct the annotation processor to search for - * obfuscation mappings for this annotation + * obfuscation mappings for this annotation (default true). */ public boolean remap() default true; }