Skip to content

Commit

Permalink
allow cache miss to set any stack it comes across, instead of just th…
Browse files Browse the repository at this point in the history
…e one we want
  • Loading branch information
ghzdude committed Oct 17, 2024
1 parent 1558a94 commit 5acc2b6
Showing 1 changed file with 9 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -388,14 +388,16 @@ public int handleCacheMiss(ItemStack stack) {
var curStack = this.availableHandlers.getStackInSlot(i);
if (curStack.isEmpty()) continue;

Set<Integer> slots;
if (stackLookupMap.containsKey(stack))
slots = stackLookupMap.get(stack);
else {
stackLookupMap.put(stack.copy(), slots = new IntArraySet());
}
slots.add(i);

if (this.strategy.equals(stack, curStack)) {
Set<Integer> slots;
if (stackLookupMap.containsKey(stack))
slots = stackLookupMap.get(stack);
else {
stackLookupMap.put(stack.copy(), slots = new IntArraySet());
}
if (slots.add(i)) return i;
return i;
}
}
return -1;
Expand Down

0 comments on commit 5acc2b6

Please sign in to comment.