diff --git a/src/main/java/forge/gui/deckeditor/controllers/CEditorQuestCardShop.java b/src/main/java/forge/gui/deckeditor/controllers/CEditorQuestCardShop.java index 12d5f302eb2..04357136d85 100644 --- a/src/main/java/forge/gui/deckeditor/controllers/CEditorQuestCardShop.java +++ b/src/main/java/forge/gui/deckeditor/controllers/CEditorQuestCardShop.java @@ -364,7 +364,6 @@ public final class CEditorQuestCardShop extends ACEditorBase newCards = booster.getCards(); - final List newInventory = new LinkedList(newCards); + + ItemPool newInventory = new ItemPool(InventoryItem.class); + newInventory.addAllFlat(newCards); getDeckManager().addItems(newInventory); - final CardListViewer c = new CardListViewer(booster.getName(), - "You have found the following cards inside:", newCards); + final CardListViewer c = new CardListViewer(booster.getName(), "You have found the following cards inside:", newCards); c.show(); } - this.getCatalogManager().removeItem(item, qty); } else if (item instanceof PreconDeck) { final PreconDeck deck = (PreconDeck) item; this.questData.getCards().buyPreconDeck(deck, value); @@ -400,8 +399,8 @@ public final class CEditorQuestCardShop extends ACEditorBase extends JPanel { */ public void addItems(Iterable> itemsToAdd) { final int n = this.table.getSelectedRow(); - for (Map.Entry item : itemsToAdd) { - this.pool.add(item.getKey(), item.getValue()); - if (this.isUnfiltered()) { - this.model.addItem(item.getKey(), item.getValue()); - } - } - this.updateView(false); - this.table.fixSelection(n); - } - - /** - * - * addItems. - * - * @param itemsToAdd - */ - public void addItems(Collection itemsToAdd) { - final int n = this.table.getSelectedRow(); - for (T item : itemsToAdd) { - this.pool.add(item, 1); - if (this.isUnfiltered()) { - this.model.addItem(item, 1); - } + this.pool.addAll(itemsToAdd); + if (this.isUnfiltered()) { + this.model.addItems(itemsToAdd); } this.updateView(false); this.table.fixSelection(n);