diff options
| author | shedaniel <daniel@shedaniel.me> | 2022-04-13 20:29:04 +0800 |
|---|---|---|
| committer | shedaniel <daniel@shedaniel.me> | 2022-04-13 23:44:46 +0800 |
| commit | 90df5cb0963d3cfdea0959b188e794cc94f7a943 (patch) | |
| tree | ad74252adc52750f96895b99e26d94d61961fad6 /runtime/src/main/java/me | |
| parent | dcb5d9a1cc9105379aaf253753283090d6093f4b (diff) | |
| download | RoughlyEnoughItems-90df5cb0963d3cfdea0959b188e794cc94f7a943.tar.gz RoughlyEnoughItems-90df5cb0963d3cfdea0959b188e794cc94f7a943.tar.bz2 RoughlyEnoughItems-90df5cb0963d3cfdea0959b188e794cc94f7a943.zip | |
Check non-empty for craftable filter, Fix #663
Diffstat (limited to 'runtime/src/main/java/me')
| -rw-r--r-- | runtime/src/main/java/me/shedaniel/rei/impl/client/view/ViewsImpl.java | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/runtime/src/main/java/me/shedaniel/rei/impl/client/view/ViewsImpl.java b/runtime/src/main/java/me/shedaniel/rei/impl/client/view/ViewsImpl.java index 034ee378e..720961de3 100644 --- a/runtime/src/main/java/me/shedaniel/rei/impl/client/view/ViewsImpl.java +++ b/runtime/src/main/java/me/shedaniel/rei/impl/client/view/ViewsImpl.java @@ -375,6 +375,7 @@ public class ViewsImpl implements Views { InfoContext context = new InfoContext(display); Iterable<SlotAccessor> inputSlots = info != null ? info.getInputSlots(context) : Collections.emptySet(); int slotsCraftable = 0; + boolean containsNonEmpty = false; List<EntryIngredient> requiredInput = display.getRequiredEntries(); Long2LongMap invCount = new Long2LongOpenHashMap(CraftableFilter.INSTANCE.getInvStacks()); for (SlotAccessor inputSlot : inputSlots) { @@ -405,12 +406,13 @@ public class ViewsImpl implements Views { long availableAmount = invCount.get(hashFuzzy); if (availableAmount >= stack.getCount()) { invCount.put(hashFuzzy, availableAmount - stack.getCount()); + containsNonEmpty = true; slotsCraftable++; break; } } } - if (slotsCraftable == display.getRequiredEntries().size()) { + if (slotsCraftable == display.getRequiredEntries().size() && containsNonEmpty) { display.getOutputEntries().stream().flatMap(Collection::stream).collect(Collectors.toCollection(() -> craftables)); } } |
