mirror of
https://github.com/LegacyModdingMC/UniMix.git
synced 2026-11-22 01:32:12 +00:00
Add support for Overwrite annotation on non-obfuscated methods
This commit is contained in:
1 parent
87a3837b13
commit
41e53c4942
5 files changed
+38
-19
No files matched your search
+13
-8
@@ -45,8 +45,15 @@ class AnnotatedMixinElementHandlerOverwrite extends AnnotatedMixinElementHandler
|
||||
*/
|
||||
static class AnnotatedElementOverwrite extends AnnotatedElement<ExecutableElement> {
|
||||
|
||||
public AnnotatedElementOverwrite(ExecutableElement element, AnnotationHandle annotation) {
|
||||
private final boolean shouldRemap;
|
||||
|
||||
public AnnotatedElementOverwrite(ExecutableElement element, AnnotationHandle annotation, boolean shouldRemap) {
|
||||
super(element, annotation);
|
||||
this.shouldRemap = shouldRemap;
|
||||
}
|
||||
|
||||
public boolean shouldRemap() {
|
||||
return this.shouldRemap;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -64,13 +71,11 @@ class AnnotatedMixinElementHandlerOverwrite extends AnnotatedMixinElementHandler
|
||||
this.validateTargetMethod(elem.getElement(), elem.getAnnotation(), name, "@Overwrite", true, false);
|
||||
this.checkConstraints(elem.getElement(), elem.getAnnotation());
|
||||
|
||||
if (!this.mixin.remap()) {
|
||||
return;
|
||||
}
|
||||
|
||||
for (TypeHandle target : this.mixin.getTargets()) {
|
||||
if (!this.registerOverwriteForTarget(elem, target)) {
|
||||
return;
|
||||
if (elem.shouldRemap()) {
|
||||
for (TypeHandle target : this.mixin.getTargets()) {
|
||||
if (!this.registerOverwriteForTarget(elem, target)) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user