mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-17 11:18:01 +00:00
Update ImageView.java
This commit is contained in:
@@ -591,10 +591,12 @@ public class ImageView<T extends InventoryItem> extends ItemView<T> {
|
|||||||
Map<Comparable<?>, Pile> piles = new TreeMap<>();
|
Map<Comparable<?>, Pile> piles = new TreeMap<>();
|
||||||
for (ItemInfo itemInfo : group.items) {
|
for (ItemInfo itemInfo : group.items) {
|
||||||
Comparable<?> key = groupPileBy.fnSort.apply(itemInfo);
|
Comparable<?> key = groupPileBy.fnSort.apply(itemInfo);
|
||||||
if (!piles.containsKey(key)) {
|
if (key != null && !piles.containsKey(key)) {
|
||||||
piles.put(key, new Pile());
|
piles.put(key, new Pile());
|
||||||
}
|
}
|
||||||
piles.get(key).items.add(itemInfo);
|
Pile p = key == null ? null : piles.getOrDefault(key, null);
|
||||||
|
if (p != null)
|
||||||
|
p.items.add(itemInfo);
|
||||||
}
|
}
|
||||||
group.piles.clear();
|
group.piles.clear();
|
||||||
group.piles.addAll(piles.values());
|
group.piles.addAll(piles.values());
|
||||||
|
|||||||
Reference in New Issue
Block a user