Allow mixins to extend Object as well as target super

Anything extending Object won't be able to meaningully use "super.",
so a mismatch is not a big deal. However, given that we cannot alter
source access levels in Sponge of things that are not MC (notably
Forge and FML), there are mixins that cannot extend the appropriate
class as that class has only private constructors.
This commit is contained in:
Kobata committed 2014-12-17 06:33:29 -05:00
1 parent d8b62e03be
commit 2124f4f1a0
1 file changed
+1 -1
@@ -195,7 +195,7 @@ public class MixinTransformer extends TreeTransformer {
*/
protected void verifyClasses(ClassNode targetClass, MixinData mixin) {
String superName = mixin.getClassNode().superName;
if (targetClass.superName == null || superName == null || !targetClass.superName.equals(superName)) {
if (targetClass.superName == null || superName == null || !(targetClass.superName.equals(superName) || "java/lang/Object".equals(superName))) {
throw new InvalidMixinException("Mixin classes must have the same superclass as their target class");
}
}