mirror of
https://github.com/LegacyModdingMC/UniMix.git
synced 2026-11-28 07:55:37 +00:00
Add handling in the AP for soft implements annotations, closes #151
This commit is contained in:
1 parent
78434b5f11
commit
4934071ee7
9 files changed
+365
-33
No files matched your search
@@ -147,10 +147,11 @@ class AnnotatedMixins implements IMixinAnnotationProcessor, ITokenProvider, ITyp
|
||||
* Private constructor, get instances using {@link #getMixinsForEnvironment}
|
||||
*/
|
||||
private AnnotatedMixins(ProcessingEnvironment processingEnv) {
|
||||
this.printMessage(Kind.NOTE, "SpongePowered Mixin Annotation Processor v" + MixinBootstrap.VERSION);
|
||||
|
||||
this.env = this.detectEnvironment(processingEnv);
|
||||
this.processingEnv = processingEnv;
|
||||
|
||||
this.printMessage(Kind.NOTE, "SpongePowered MIXIN Annotation Processor Version=" + MixinBootstrap.VERSION);
|
||||
|
||||
this.targets = this.initTargetMap();
|
||||
this.obf = new ObfuscationManager(this);
|
||||
this.obf.init();
|
||||
@@ -479,6 +480,24 @@ class AnnotatedMixins implements IMixinAnnotationProcessor, ITokenProvider, ITyp
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Register an {@link org.spongepowered.asm.mixin.Implements} declaration on
|
||||
* a mixin class
|
||||
*
|
||||
* @param mixin Annotated mixin
|
||||
* @param implementsAnnotation
|
||||
* {@link org.spongepowered.asm.mixin.Implements} annotation
|
||||
*/
|
||||
public void registerSoftImplements(TypeElement mixin, AnnotationMirror implementsAnnotation) {
|
||||
AnnotatedMixin mixinClass = this.getMixin(mixin);
|
||||
if (mixinClass == null) {
|
||||
this.printMessage(Kind.ERROR, "Found @Implements annotation on a non-mixin class");
|
||||
return;
|
||||
}
|
||||
|
||||
mixinClass.registerSoftImplements(implementsAnnotation);
|
||||
}
|
||||
|
||||
/**
|
||||
* Called from each AP class to notify the environment that a new pass is
|
||||
* starting
|
||||
|
||||
Reference in new issue
Block a user