diff --git a/Mage/src/main/java/mage/players/Library.java b/Mage/src/main/java/mage/players/Library.java index 65fab4a09e..34190ca4ec 100644 --- a/Mage/src/main/java/mage/players/Library.java +++ b/Mage/src/main/java/mage/players/Library.java @@ -27,16 +27,15 @@ */ package mage.players; +import java.io.Serializable; +import java.util.*; +import java.util.stream.Collectors; import mage.cards.Card; import mage.constants.Zone; import mage.filter.FilterCard; import mage.game.Game; import mage.util.RandomUtil; -import java.io.Serializable; -import java.util.*; -import java.util.stream.Collectors; - /** * @author BetaSteward_at_googlemail.com */ @@ -64,7 +63,7 @@ public class Library implements Serializable { public void shuffle() { UUID[] shuffled = library.toArray(new UUID[0]); for (int n = shuffled.length - 1; n > 0; n--) { - int r = RandomUtil.nextInt(n); + int r = RandomUtil.nextInt(n + 1); UUID temp = shuffled[n]; shuffled[n] = shuffled[r]; shuffled[r] = temp; @@ -235,7 +234,6 @@ public class Library implements Serializable { return null; } - public boolean hasCards() { return size() > 0; }