Skip to content

Commit

Permalink
Breaking Change: Change CustomItemWithInventory
Browse files Browse the repository at this point in the history
Some Tweaks
  • Loading branch information
FirstMegaGame4 committed Aug 17, 2023
1 parent 8967d92 commit ef25fdb
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ public CustomItemWithInventory(DefaultContainer defaultContainer, Settings setti
this.inventory.addInventoryClosedListener(this::inventoryClosed);
}

public CustomItemWithInventory(int size, TriFunction<Integer, PlayerInventory, Inventory, ScreenHandler> screenHandlerFunc, Settings settings) {
public CustomItemWithInventory(TriFunction<Integer, PlayerInventory, Inventory, ScreenHandler> screenHandlerFunc, int size, Settings settings) {
super(settings.maxCount(1));
this.defaultContainer = DefaultContainer.NULL;
this.screenHandlerFunc = screenHandlerFunc;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ public BundleTooltipData toBundleTooltipData() {
}
else {
content = DefaultedList.of();
this.content.stream().filter(stack -> !stack.isEmpty()).forEach(content::add);
this.content.stream().filter(stack -> !stack.isEmpty()).forEachOrdered(content::add);
}
BasicInventory inventory = BasicInventory.of(content);
return new BundleTooltipData(inventory.getContent(), this.inventory.getMaxCountPerStack() * this.inventory.size());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ public class InventoryUtils {
public static DefaultedList<ItemStack> sort(DefaultedList<ItemStack> content) {
Map<Pair<Item, NbtCompound>, Integer> items = new HashMap<>();

content.stream().filter(stack -> !stack.isEmpty()).forEach(stack -> {
content.stream().filter(stack -> !stack.isEmpty()).forEachOrdered(stack -> {
Pair<Item, NbtCompound> item = Pair.of(stack.getItem(), stack.getNbt());
int count = items.getOrDefault(item, 0);
items.put(item, count + stack.getCount());
Expand Down

0 comments on commit ef25fdb

Please sign in to comment.