diff --git a/Mage.Sets/src/mage/cards/m/MoralityShift.java b/Mage.Sets/src/mage/cards/m/MoralityShift.java index 23ab1dea3a..be63fc0307 100644 --- a/Mage.Sets/src/mage/cards/m/MoralityShift.java +++ b/Mage.Sets/src/mage/cards/m/MoralityShift.java @@ -27,6 +27,7 @@ */ package mage.cards.m; +import java.util.HashSet; import java.util.List; import java.util.Set; import java.util.UUID; @@ -37,6 +38,7 @@ import mage.cards.CardImpl; import mage.cards.CardSetInfo; import mage.constants.CardType; import mage.constants.Outcome; +import mage.constants.Zone; import mage.game.Game; import mage.players.Player; @@ -85,12 +87,16 @@ class MoralityShiftEffect extends OneShotEffect { public boolean apply(Game game, Ability source) { Player controller = game.getPlayer(source.getControllerId()); if (controller != null) { - List copyLibrary = controller.getLibrary().getCards(game); + Set copyLibrary = new HashSet<>(); + List listCopyLibrary = controller.getLibrary().getCards(game); + listCopyLibrary.forEach((card) -> { + copyLibrary.add(card); + }); Set copyGraveyard = controller.getGraveyard().getCards(game); controller.getLibrary().clear(); controller.getGraveyard().clear(); - controller.getGraveyard().addAll(copyLibrary); - controller.getLibrary().addAll(copyGraveyard, game); + controller.moveCards(copyLibrary, Zone.GRAVEYARD, source, game); + controller.moveCards(copyGraveyard, Zone.LIBRARY, source, game); controller.shuffleLibrary(source, game); return true; }