Skip to content

Commit

Permalink
a few more optimizations
Browse files Browse the repository at this point in the history
  • Loading branch information
ghzdude committed Aug 28, 2024
1 parent c1fbd39 commit e8cc940
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -286,7 +286,7 @@ public ItemStack findSubstitute(int craftingIndex, ItemStack stack) {
*/
private boolean simulateExtractItem(ItemStack itemStack, int count) {
if (itemStack.isEmpty()) return true;
if (!stackLookupMap.containsKey(itemStack)) {
if (!stackLookupMap.containsKey(itemStack) || stackLookupMap.get(itemStack).isEmpty()) {
if (handleCacheMiss(itemStack) == -1)
return false;
}
Expand Down Expand Up @@ -339,7 +339,7 @@ public void detectAndSendChanges(boolean init) {

// check if existing stack works
var slotStack = slot.getStack();
if (slotStack.isEmpty()) {
if (slotStack.isEmpty() && !old) {
slot.hasIngredients = true;
map.put(slot.getIndex(), slot.hasIngredients);
continue;
Expand Down

0 comments on commit e8cc940

Please sign in to comment.