mirror of
https://github.com/LegacyModdingMC/UniMix.git
synced 2026-11-21 20:52:29 +00:00
Respect remap on Mixin for At, allow annot to override mixin, fixes #177
This commit is contained in:
1 parent
ffc72c7ab6
commit
3329a3d084
3 files changed
+10
-4
No files matched your search
+6
-1
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
@@ -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());
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -77,10 +77,11 @@ public @interface Mixin {
|
||||
* <em>false</em> on the individual annotations, or disabled for the entire
|
||||
* mixin by setting the value here to <em>false</em>. 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 <tt>remap = true</tt>.
|
||||
*
|
||||
* @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;
|
||||
}
|
||||
Reference in new issue
Block a user