mirror of
https://github.com/magefree/mage.git
synced 2025-12-25 13:02:06 -08:00
Fixed a problem with images of transformed cards. Workaround for images of basic lands. Does not work correctly yet, because card art od basic lands is switched between various versions continuously.
This commit is contained in:
parent
e46895420e
commit
67cf1604c9
4 changed files with 56 additions and 22 deletions
|
|
@ -186,8 +186,7 @@ public abstract class CardImpl extends MageObjectImpl implements Card {
|
|||
if (setInfo == null) {
|
||||
Constructor<?> con = clazz.getConstructor(UUID.class);
|
||||
card = (Card) con.newInstance(new Object[]{null});
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
Constructor<?> con = clazz.getConstructor(UUID.class, CardSetInfo.class);
|
||||
card = (Card) con.newInstance(null, setInfo);
|
||||
}
|
||||
|
|
@ -559,7 +558,7 @@ public abstract class CardImpl extends MageObjectImpl implements Card {
|
|||
|
||||
@Override
|
||||
public final Card getSecondCardFace() {
|
||||
if (secondSideCardClazz == null) {
|
||||
if (secondSideCardClazz == null && secondSideCard == null) {
|
||||
return null;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,10 +1,10 @@
|
|||
package mage.cards;
|
||||
|
||||
import java.io.Serializable;
|
||||
import mage.constants.Rarity;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
public final class CardSetInfo implements Serializable {
|
||||
|
||||
private final String name;
|
||||
private final String cardNumber;
|
||||
private final String expansionSetCode;
|
||||
|
|
@ -20,16 +20,31 @@ public final class CardSetInfo implements Serializable {
|
|||
this.expansionSetCode = expansionSetCode;
|
||||
this.cardNumber = cardNumber;
|
||||
this.rarity = rarity;
|
||||
this.graphicInfo = graphicInfo;
|
||||
if (graphicInfo == null && Rarity.LAND.equals(rarity)) {
|
||||
// Workaround to get images of basic land permanents loaded
|
||||
this.graphicInfo = new CardGraphicInfo(null, true);
|
||||
} else {
|
||||
this.graphicInfo = graphicInfo;
|
||||
}
|
||||
}
|
||||
|
||||
public String getName() { return this.name; }
|
||||
public String getName() {
|
||||
return this.name;
|
||||
}
|
||||
|
||||
public String getExpansionSetCode() { return this.expansionSetCode; }
|
||||
public String getExpansionSetCode() {
|
||||
return this.expansionSetCode;
|
||||
}
|
||||
|
||||
public String getCardNumber() { return this.cardNumber; }
|
||||
public String getCardNumber() {
|
||||
return this.cardNumber;
|
||||
}
|
||||
|
||||
public Rarity getRarity() { return this.rarity; }
|
||||
public Rarity getRarity() {
|
||||
return this.rarity;
|
||||
}
|
||||
|
||||
public CardGraphicInfo getGraphicInfo() { return this.graphicInfo; }
|
||||
public CardGraphicInfo getGraphicInfo() {
|
||||
return this.graphicInfo;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -33,8 +33,6 @@ import java.util.Date;
|
|||
import java.util.EnumMap;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
|
||||
import mage.ObjectColor;
|
||||
import mage.cards.repository.CardCriteria;
|
||||
import mage.cards.repository.CardInfo;
|
||||
import mage.cards.repository.CardRepository;
|
||||
|
|
@ -46,7 +44,9 @@ import mage.util.RandomUtil;
|
|||
* @author BetaSteward_at_googlemail.com
|
||||
*/
|
||||
public abstract class ExpansionSet implements Serializable {
|
||||
|
||||
public class SetCardInfo implements Serializable {
|
||||
|
||||
private final String name;
|
||||
private final String cardNumber;
|
||||
private final Rarity rarity;
|
||||
|
|
@ -71,21 +71,37 @@ public abstract class ExpansionSet implements Serializable {
|
|||
this.cardNumber = cardNumber;
|
||||
this.rarity = rarity;
|
||||
this.cardClass = cardClass;
|
||||
this.usesVariousArt = false;
|
||||
if (graphicInfo != null) {
|
||||
this.usesVariousArt = graphicInfo.getUsesVariousArt();
|
||||
} else {
|
||||
usesVariousArt = false;
|
||||
}
|
||||
this.graphicInfo = graphicInfo;
|
||||
}
|
||||
|
||||
public String getName() { return this.name; }
|
||||
public String getName() {
|
||||
return this.name;
|
||||
}
|
||||
|
||||
public String getCardNumber() { return this.cardNumber; }
|
||||
public String getCardNumber() {
|
||||
return this.cardNumber;
|
||||
}
|
||||
|
||||
public Rarity getRarity() { return this.rarity; }
|
||||
public Rarity getRarity() {
|
||||
return this.rarity;
|
||||
}
|
||||
|
||||
public Class<?> getCardClass() { return this.cardClass; }
|
||||
public Class<?> getCardClass() {
|
||||
return this.cardClass;
|
||||
}
|
||||
|
||||
public boolean getUsesVariousArt() { return this.usesVariousArt; }
|
||||
public boolean getUsesVariousArt() {
|
||||
return this.usesVariousArt;
|
||||
}
|
||||
|
||||
public CardGraphicInfo getGraphicInfo() { return this.graphicInfo; }
|
||||
public CardGraphicInfo getGraphicInfo() {
|
||||
return this.graphicInfo;
|
||||
}
|
||||
}
|
||||
|
||||
protected final List<SetCardInfo> cards = new ArrayList<>();
|
||||
|
|
@ -153,7 +169,9 @@ public abstract class ExpansionSet implements Serializable {
|
|||
return blockName;
|
||||
}
|
||||
|
||||
public List<SetCardInfo> getSetCardInfo() { return cards; }
|
||||
public List<SetCardInfo> getSetCardInfo() {
|
||||
return cards;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue