mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-16 02:38:02 +00:00
- Do not go through the process of adding items to a card pool if it's already infinite (fixes slowdown when removing a card from the deck in the Constructed deck editor)
This commit is contained in:
@@ -719,6 +719,9 @@ public abstract class ItemManager<T extends InventoryItem> extends JPanel implem
|
||||
*/
|
||||
@Override
|
||||
public void addItem(final T item, final int qty) {
|
||||
if (this.isInfinite()) {
|
||||
return;
|
||||
}
|
||||
this.pool.add(item, qty);
|
||||
if (this.isUnfiltered()) {
|
||||
this.model.addItem(item, qty);
|
||||
@@ -736,6 +739,9 @@ public abstract class ItemManager<T extends InventoryItem> extends JPanel implem
|
||||
*/
|
||||
@Override
|
||||
public void addItems(final Iterable<Entry<T, Integer>> itemsToAdd) {
|
||||
if (this.isInfinite()) {
|
||||
return;
|
||||
}
|
||||
this.pool.addAll(itemsToAdd);
|
||||
if (this.isUnfiltered()) {
|
||||
this.model.addItems(itemsToAdd);
|
||||
|
||||
Reference in New Issue
Block a user