From e4d5665de955e8f9377df2fc15bbfeb765dcaa95 Mon Sep 17 00:00:00 2001 From: shedaniel Date: Fri, 24 Jan 2020 23:05:57 +0800 Subject: 3.3.16 --- src/main/java/me/shedaniel/rei/impl/RecipeHelperImpl.java | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'src/main/java/me/shedaniel/rei/impl/RecipeHelperImpl.java') diff --git a/src/main/java/me/shedaniel/rei/impl/RecipeHelperImpl.java b/src/main/java/me/shedaniel/rei/impl/RecipeHelperImpl.java index c8cadf503..b0a19fc75 100644 --- a/src/main/java/me/shedaniel/rei/impl/RecipeHelperImpl.java +++ b/src/main/java/me/shedaniel/rei/impl/RecipeHelperImpl.java @@ -58,7 +58,7 @@ public class RecipeHelperImpl implements RecipeHelper { public List findCraftableEntriesByItems(List inventoryItems) { List craftables = new ArrayList<>(); for (List value : recipeCategoryListMap.values()) - for (RecipeDisplay recipeDisplay : value) { + for (RecipeDisplay recipeDisplay : Lists.newArrayList(value)) { int slotsCraftable = 0; List> requiredInput = recipeDisplay.getRequiredEntries(); for (List slot : requiredInput) { @@ -132,7 +132,7 @@ public class RecipeHelperImpl implements RecipeHelper { RecipeCategory category = entry.getKey(); Identifier categoryId = entry.getValue(); Set set = Sets.newLinkedHashSet(); - for (RecipeDisplay display : recipeCategoryListMap.get(categoryId)) { + for (RecipeDisplay display : Lists.newArrayList(recipeCategoryListMap.get(categoryId))) { for (EntryStack outputStack : display.getOutputEntries()) if (stack.equals(outputStack) && isDisplayVisible(display)) { set.add(display); @@ -185,7 +185,7 @@ public class RecipeHelperImpl implements RecipeHelper { Set set = Sets.newLinkedHashSet(); RecipeCategory category = entry.getKey(); Identifier categoryId = entry.getValue(); - for (RecipeDisplay display : recipeCategoryListMap.get(categoryId)) { + for (RecipeDisplay display : Lists.newArrayList(recipeCategoryListMap.get(categoryId))) { back: for (List input : display.getInputEntries()) { for (EntryStack otherEntry : input) { @@ -198,7 +198,7 @@ public class RecipeHelperImpl implements RecipeHelper { } } if (isStackWorkStationOfCategory(categoryId, stack)) { - set.addAll(recipeCategoryListMap.get(categoryId)); + set.addAll(Lists.newArrayList(recipeCategoryListMap.get(categoryId))); } if (!set.isEmpty()) CollectionUtils.getOrPutEmptyList(result, category).addAll(set); @@ -378,11 +378,11 @@ public class RecipeHelperImpl implements RecipeHelper { for (Map.Entry, Identifier> entry : categories.entrySet()) { RecipeCategory category = entry.getKey(); Identifier categoryId = entry.getValue(); - List displays = recipeCategoryListMap.get(categoryId); + List displays = Lists.newArrayList(recipeCategoryListMap.get(categoryId)); if (displays != null) { displays.removeIf(this::isDisplayNotVisible); if (!displays.isEmpty()) - result.put(category, Lists.newArrayList(displays)); + result.put(category, displays); } } return result; @@ -390,7 +390,7 @@ public class RecipeHelperImpl implements RecipeHelper { @Override public List getAllRecipesFromCategory(RecipeCategory category) { - return recipeCategoryListMap.get(category.getIdentifier()); + return Lists.newArrayList(recipeCategoryListMap.get(category.getIdentifier())); } @Override -- cgit