diff --git a/Mage/src/main/java/mage/cards/CardImpl.java b/Mage/src/main/java/mage/cards/CardImpl.java index 2ebac99fff..da68aaec52 100644 --- a/Mage/src/main/java/mage/cards/CardImpl.java +++ b/Mage/src/main/java/mage/cards/CardImpl.java @@ -28,6 +28,7 @@ package mage.cards; import java.lang.reflect.Constructor; +import java.lang.reflect.InvocationTargetException; import java.util.*; import mage.MageObject; import mage.MageObjectImpl; @@ -205,22 +206,30 @@ public abstract class CardImpl extends MageObjectImpl implements Card { } public static Card createCard(Class clazz, CardSetInfo setInfo, List errorList) { + String setCode = null; try { Card card; if (setInfo == null) { Constructor con = clazz.getConstructor(UUID.class); card = (Card) con.newInstance(new Object[]{null}); } else { + setCode = setInfo.getExpansionSetCode(); Constructor con = clazz.getConstructor(UUID.class, CardSetInfo.class); card = (Card) con.newInstance(null, setInfo); } return card; } catch (Exception e) { - String err = "Error loading card: " + clazz.getCanonicalName(); + String err = "Error loading card: " + clazz.getCanonicalName() + " (" + setCode + ")"; if (errorList != null) { errorList.add(err); } - logger.fatal(err, e); + + if (e instanceof InvocationTargetException) { + logger.fatal(err, ((InvocationTargetException) e).getTargetException()); + } else { + logger.fatal(err, e); + } + return null; } } diff --git a/Mage/src/main/java/mage/target/common/TargetNonBasicLandPermanent.java b/Mage/src/main/java/mage/target/common/TargetNonBasicLandPermanent.java index fed264a654..27f1d2f6c5 100644 --- a/Mage/src/main/java/mage/target/common/TargetNonBasicLandPermanent.java +++ b/Mage/src/main/java/mage/target/common/TargetNonBasicLandPermanent.java @@ -29,6 +29,7 @@ package mage.target.common; import mage.constants.SuperType; +import mage.filter.common.FilterLandPermanent; import mage.filter.predicate.Predicates; import mage.filter.predicate.mageobject.SupertypePredicate; @@ -39,7 +40,8 @@ import mage.filter.predicate.mageobject.SupertypePredicate; public class TargetNonBasicLandPermanent extends TargetLandPermanent { public TargetNonBasicLandPermanent() { - filter.add(Predicates.not(new SupertypePredicate(SuperType.BASIC))); + this.filter = new FilterLandPermanent(); + this.filter.add(Predicates.not(new SupertypePredicate(SuperType.BASIC))); this.targetName = "nonbasic land"; }