Skip to content

Commit

Permalink
change
Browse files Browse the repository at this point in the history
  • Loading branch information
anviaan committed Jul 19, 2024
1 parent 0197465 commit c8bfdff
Showing 1 changed file with 1 addition and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;

public class SortInventory {
private static final int HOTBAR_SIZE = 9;
Expand Down Expand Up @@ -49,7 +48,7 @@ private static ItemStack mergeStacks(ItemStack existing, ItemStack incoming) {
private static DefaultedList<ItemStack> sortAndFilterInventory(Map<String, ItemStack> groupedItems) {
List<ItemStack> sortedList = groupedItems.values().stream()
.sorted(Comparator.comparing(stack -> stack.getItem().getName(stack).getString()))
.collect(Collectors.toList());
.toList();

return DefaultedList.copyOf(ItemStack.EMPTY, sortedList.toArray(new ItemStack[0]));
}
Expand Down

0 comments on commit c8bfdff

Please sign in to comment.