mirror of
https://github.com/LegacyModdingMC/UniMix.git
synced 2026-11-27 21:22:56 +00:00
Further AP refactor, support injectors and shadows in multitarget mixins
This commit is contained in:
1 parent
8d87440faf
commit
ea44243240
17 files changed
+587
-144
No files matched your search
@@ -98,15 +98,10 @@ class AnnotatedMixin {
|
||||
*/
|
||||
private final List<TypeHandle> targets = new ArrayList<TypeHandle>();
|
||||
|
||||
/**
|
||||
* Target "reference" (bytecode name)
|
||||
*/
|
||||
private final String targetRef;
|
||||
|
||||
/**
|
||||
* Target type (for single-target mixins)
|
||||
*/
|
||||
private final TypeHandle targetType;
|
||||
private final TypeHandle primaryTarget;
|
||||
|
||||
/**
|
||||
* Mixin class "reference" (bytecode name)
|
||||
@@ -142,16 +137,7 @@ class AnnotatedMixin {
|
||||
this.mixin = type;
|
||||
this.handle = new TypeHandle(type);
|
||||
this.classRef = type.getQualifiedName().toString().replace('.', '/');
|
||||
|
||||
TypeHandle primaryTarget = this.initTargets();
|
||||
if (primaryTarget != null) {
|
||||
this.targetRef = primaryTarget.getName();
|
||||
this.targetType = primaryTarget;
|
||||
} else {
|
||||
this.targetRef = null;
|
||||
this.targetType = null;
|
||||
}
|
||||
|
||||
this.primaryTarget = this.initTargets();
|
||||
this.remap = AnnotatedMixins.getRemapValue(this.annotation) && this.targets.size() > 0;
|
||||
|
||||
this.overwrites = new AnnotatedMixinOverwriteHandler(ap, this);
|
||||
@@ -279,18 +265,12 @@ class AnnotatedMixin {
|
||||
return this.mixin.getKind() == ElementKind.INTERFACE;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the <em>primary</em> target class reference
|
||||
*/
|
||||
public String getPrimaryTargetRef() {
|
||||
return this.targetRef;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the <em>primary</em> target
|
||||
*/
|
||||
@Deprecated
|
||||
public TypeHandle getPrimaryTarget() {
|
||||
return this.targetType;
|
||||
return this.primaryTarget;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -300,6 +280,13 @@ class AnnotatedMixin {
|
||||
return this.targets;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get whether this is a multi-target mixin
|
||||
*/
|
||||
public boolean isMultiTarget() {
|
||||
return this.targets.size() > 1;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get whether to remap annotations in this mixin
|
||||
*/
|
||||
|
||||
Reference in new issue
Block a user