Skip to content

Commit 4ce32a8

Browse files
committed
fixing sorting type
1 parent 2e3b72f commit 4ce32a8

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

gradle.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ yarn_mappings=1.21+build.9
99
loader_version=0.15.11
1010

1111
# Mod Properties
12-
mod_version=2.1
12+
mod_version=2.2
1313
maven_group=net.anvian.inventorytweaks
1414
archives_base_name=InventoryTweaks
1515

src/main/java/net/anvian/inventorytweaks/sort/SortInventory.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,8 @@ private static List<Integer> getSortedSlots(InventorySlots inventorySlots, Scree
7272
} else {
7373
return inventorySlots.stream()
7474
.filter(slot -> !screenHandler.getSlot(slot).getStack().isEmpty())
75-
.sorted(Comparator.comparing((Integer slot) -> Item.getRawId(screenHandler.getSlot(slot).getStack().getItem())))
75+
.sorted(Comparator.comparing((Integer slot) -> Item.getRawId(screenHandler.getSlot(slot).getStack().getItem()))
76+
.thenComparing(slot -> screenHandler.getSlot(slot).getStack().getCount(), Comparator.reverseOrder()))
7677
.toList();
7778
}
7879

0 commit comments

Comments
 (0)