From 7d438f554c4173880a407a6bb8fc80b8a4723845 Mon Sep 17 00:00:00 2001 From: vhd Date: Mon, 23 Dec 2019 13:19:15 +0200 Subject: Added workstation usage info when looking for usage of item/block --- .../me/shedaniel/rei/impl/RecipeHelperImpl.java | 24 +++++++++++++--------- 1 file changed, 14 insertions(+), 10 deletions(-) (limited to 'src') 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> categoriesMap = new HashMap<>(); categories.forEach(f -> categoriesMap.put(f.getIdentifier(), Lists.newArrayList())); for (Map.Entry> 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 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 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; } } } -- cgit