aboutsummaryrefslogtreecommitdiff
path: root/src/main
diff options
context:
space:
mode:
authorvhd <sudo.vhd@gmail.com>2019-12-23 13:19:15 +0200
committervhd <sudo.vhd@gmail.com>2019-12-23 13:19:15 +0200
commit7d438f554c4173880a407a6bb8fc80b8a4723845 (patch)
tree4d8e7141cdf5e960a8a19568547c658b960564c5 /src/main
parent652b1bf5bc0713f232ae231c88c4e6398b65ae8f (diff)
downloadRoughlyEnoughItems-7d438f554c4173880a407a6bb8fc80b8a4723845.tar.gz
RoughlyEnoughItems-7d438f554c4173880a407a6bb8fc80b8a4723845.tar.bz2
RoughlyEnoughItems-7d438f554c4173880a407a6bb8fc80b8a4723845.zip
Added workstation usage info when looking for usage of item/block
Diffstat (limited to 'src/main')
-rw-r--r--src/main/java/me/shedaniel/rei/impl/RecipeHelperImpl.java24
1 files changed, 14 insertions, 10 deletions
diff --git a/src/main/java/me/shedaniel/rei/impl/RecipeHelperImpl.java b/src/main/java/me/shedaniel/rei/impl/RecipeHelperImpl.java
index 7e5846bc3..21ea623a0 100644
--- a/src/main/java/me/shedaniel/rei/impl/RecipeHelperImpl.java
+++ b/src/main/java/me/shedaniel/rei/impl/RecipeHelperImpl.java
@@ -170,19 +170,23 @@ public class RecipeHelperImpl implements RecipeHelper {
Map<Identifier, List<RecipeDisplay>> categoriesMap = new HashMap<>();
categories.forEach(f -> categoriesMap.put(f.getIdentifier(), Lists.newArrayList()));
for (Map.Entry<Identifier, List<RecipeDisplay>> entry : recipeCategoryListMap.entrySet()) {
- RecipeCategory<?> category = getCategory(entry.getKey());
+ boolean isWorkstationCategory = getWorkingStations(entry.getKey()).stream().anyMatch(ws -> ws.contains(stack));
for (RecipeDisplay recipeDisplay : entry.getValue()) {
- boolean found = false;
- for (List<EntryStack> input : recipeDisplay.getInputEntries()) {
- for (EntryStack otherEntry : input) {
- if (otherEntry.equals(stack)) {
- categoriesMap.get(recipeDisplay.getRecipeCategory()).add(recipeDisplay);
- found = true;
- break;
+ if (isWorkstationCategory) {
+ categoriesMap.get(recipeDisplay.getRecipeCategory()).add(recipeDisplay);
+ } else {
+ boolean found = false;
+ for (List<EntryStack> input : recipeDisplay.getInputEntries()) {
+ for (EntryStack otherEntry : input) {
+ if (otherEntry.equals(stack)) {
+ categoriesMap.get(recipeDisplay.getRecipeCategory()).add(recipeDisplay);
+ found = true;
+ break;
+ }
}
+ if (found)
+ break;
}
- if (found)
- break;
}
}
}