mirror of
https://github.com/GTNewHorizons/ForestryMC.git
synced 2026-11-25 14:24:42 +00:00
Fix #1086 Squeezer NEI integration can't lookup multi stack recipes.
This commit is contained in:
1 parent
98e13299d6
commit
99020cde7f
2 files changed
+13
-3
No files matched your search
@@ -79,6 +79,18 @@ public class SqueezerRecipeManager implements ISqueezerManager {
|
||||
return null;
|
||||
}
|
||||
|
||||
public static ISqueezerRecipe findRecipeWithIngredient(ItemStack ingredient) {
|
||||
for (ISqueezerRecipe recipe : recipes) {
|
||||
for (ItemStack recipeIngredient : recipe.getResources()) {
|
||||
if (ItemStackUtil.isCraftingEquivalent(recipeIngredient, ingredient, false, false)) {
|
||||
return recipe;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
public static boolean canUse(ItemStack itemStack) {
|
||||
for (ISqueezerRecipe recipe : recipes) {
|
||||
for (ItemStack recipeInput : recipe.getResources()) {
|
||||
|
||||
@@ -246,11 +246,9 @@ public class NEIHandlerSqueezer extends RecipeHandlerBase {
|
||||
return;
|
||||
}
|
||||
|
||||
ISqueezerRecipe recipe = SqueezerRecipeManager.findMatchingRecipe(new ItemStack[]{ingred});
|
||||
ISqueezerRecipe recipe = SqueezerRecipeManager.findRecipeWithIngredient(ingred);
|
||||
if (recipe != null) {
|
||||
CachedSqueezerRecipe crecipe = new CachedSqueezerRecipe(recipe);
|
||||
// Override recipe to show the right input in case it's OD
|
||||
crecipe.setIngredients(new ItemStack[]{ingred});
|
||||
this.arecipes.add(crecipe);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user