diff --git a/src/main/java/forge/item/PrintSheet.java b/src/main/java/forge/item/PrintSheet.java index d62909c3354..85ee5a1c4eb 100644 --- a/src/main/java/forge/item/PrintSheet.java +++ b/src/main/java/forge/item/PrintSheet.java @@ -71,13 +71,22 @@ public class PrintSheet { public List random(int number, boolean wantUnique) { List result = new ArrayList(); - + int totalWeight = cardsWithWeights.countAll(); if( totalWeight == 0) { System.err.println("No cards were found on sheet " + name); return result; } + // If they ask for 40 unique basic lands (to make a fatpack) out of 20 distinct possible, add the whole print run N times. + int uniqueCards = cardsWithWeights.countDistinct(); + while ( number >= uniqueCards ) { + for(Entry kv : cardsWithWeights) { + result.add(kv.getKey()); + } + number -= uniqueCards; + } + for(int iC = 0; iC < number; iC++) { int index = MyRandom.getRandom().nextInt(totalWeight); CardPrinted toAdd = fetchRoulette(0, index, wantUnique ? result : null); @@ -98,4 +107,5 @@ public class PrintSheet { } + }