mirror of
https://github.com/LegacyModdingMC/UniMix.git
synced 2026-11-21 05:42:15 +00:00
Handle passthrough correctly when mixin config packages overlap
This commit is contained in:
1 parent
eb4e693cde
commit
90a4c0f165
1 file changed
+7
-2
@@ -295,14 +295,15 @@ public class MixinTransformer extends TreeTransformer {
|
||||
|
||||
try {
|
||||
SortedSet<MixinInfo> mixins = null;
|
||||
boolean invalidRef = false;
|
||||
|
||||
for (MixinConfig config : this.configs) {
|
||||
if (config.packageMatch(transformedName)) {
|
||||
if (config.canPassThrough(transformedName)) {
|
||||
return this.passThrough(name, transformedName, basicClass);
|
||||
}
|
||||
|
||||
throw new NoClassDefFoundError(String.format("%s is a mixin class and cannot be referenced directly", transformedName));
|
||||
invalidRef = true;
|
||||
continue;
|
||||
}
|
||||
|
||||
if (config.hasMixinsFor(transformedName)) {
|
||||
@@ -315,6 +316,10 @@ public class MixinTransformer extends TreeTransformer {
|
||||
}
|
||||
}
|
||||
|
||||
if (invalidRef) {
|
||||
throw new NoClassDefFoundError(String.format("%s is a mixin class and cannot be referenced directly", transformedName));
|
||||
}
|
||||
|
||||
if (mixins != null) {
|
||||
// Re-entrance is "safe" as long as we don't need to apply any mixins, if there are mixins then we need to panic now
|
||||
if (locked) {
|
||||
|
||||
Reference in new issue
Block a user