mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-19 20:28:00 +00:00
When current deck is Empty, CardEdition returned is not ZEN anymore but one depending on current Art Preference
This commit is contained in:
@@ -691,11 +691,18 @@ public class DeckProxy implements InventoryItem {
|
|||||||
List<CardEdition> availableEditions = new ArrayList<>();
|
List<CardEdition> availableEditions = new ArrayList<>();
|
||||||
|
|
||||||
for (PaperCard c : deck.getAllCardsInASinglePool().toFlatList()) {
|
for (PaperCard c : deck.getAllCardsInASinglePool().toFlatList()) {
|
||||||
availableEditions.add(FModel.getMagicDb().getEditions().get(c.getEdition()));
|
CardEdition edition = FModel.getMagicDb().getEditions().get(c.getEdition());
|
||||||
|
if (edition == null)
|
||||||
|
continue;
|
||||||
|
availableEditions.add(edition);
|
||||||
}
|
}
|
||||||
|
|
||||||
CardEdition randomLandSet = CardEdition.Predicates.getRandomSetWithAllBasicLands(availableEditions);
|
CardEdition randomLandSet = CardEdition.Predicates.getRandomSetWithAllBasicLands(availableEditions);
|
||||||
return randomLandSet == null ? FModel.getMagicDb().getEditions().get("ZEN") : randomLandSet;
|
if (randomLandSet == null) {
|
||||||
|
CardEdition preferredArtEdition = CardEdition.Predicates.getPreferredArtEditionWithAllBasicLands();
|
||||||
|
return preferredArtEdition != null ? preferredArtEdition : FModel.getMagicDb().getEditions().get("ZEN");
|
||||||
|
}
|
||||||
|
return randomLandSet;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static final Predicate<DeckProxy> IS_WHITE = new Predicate<DeckProxy>() {
|
public static final Predicate<DeckProxy> IS_WHITE = new Predicate<DeckProxy>() {
|
||||||
|
|||||||
Reference in New Issue
Block a user