mirror of
https://github.com/GTNewHorizons/Botania.git
synced 2026-11-23 21:49:50 +00:00
Use positionedStackContainsWithNBT
This commit is contained in:
1 parent
5e59b54f97
commit
c1bac66d2a
2 files changed
+4
-2
No files matched your search
+2
-1
@@ -152,7 +152,8 @@ public class RecipeHandlerManaPool extends TemplateRecipeHandler {
|
||||
if (recipe == null) continue;
|
||||
|
||||
CachedManaPoolRecipe crecipe = new CachedManaPoolRecipe(recipe);
|
||||
if (ItemNBTHelper.cachedRecipeContainsWithNBT(crecipe.getIngredients(), ingredient) || ItemNBTHelper.cachedRecipeContainsWithNBT(crecipe.getOtherStacks(), ingredient)) {
|
||||
if ((ItemNBTHelper.positionedStackContainsWithNBT(crecipe.input, ingredient)) ||
|
||||
(ItemNBTHelper.positionedStackContainsWithNBT(crecipe.catalyst, ingredient))) {
|
||||
arecipes.add(crecipe);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -22,7 +22,6 @@ import net.minecraftforge.oredict.OreDictionary;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
import java.util.Collection;
|
||||
import java.util.Set;
|
||||
|
||||
public final class ItemNBTHelper {
|
||||
|
||||
@@ -221,6 +220,7 @@ public final class ItemNBTHelper {
|
||||
* NBT-friendly version of {@link codechicken.nei.recipe.TemplateRecipeHandler.CachedRecipe#contains(Collection, ItemStack)}
|
||||
*/
|
||||
public static boolean cachedRecipeContainsWithNBT(Collection<PositionedStack> ingredients, ItemStack ingredient) {
|
||||
if (ingredients == null) return false;
|
||||
for (PositionedStack stack : ingredients)
|
||||
if (positionedStackContainsWithNBT(stack, ingredient))
|
||||
return true;
|
||||
@@ -232,6 +232,7 @@ public final class ItemNBTHelper {
|
||||
* NBT-friendly version of {@link codechicken.nei.PositionedStack#contains(ItemStack)}
|
||||
*/
|
||||
public static boolean positionedStackContainsWithNBT(PositionedStack stack, ItemStack ingredient) {
|
||||
if (stack == null) return false;
|
||||
for(ItemStack item : stack.items)
|
||||
if(areStacksSameTypeCraftingWithNBT(item, ingredient))
|
||||
return true;
|
||||
|
||||
Reference in new issue
Block a user