Merge pull request #4 from GTNewHorizons/nbt-nei

Fix irrelevant flowers show up in NEI
This commit is contained in:
Martin Robertz authored and GitHub committed 2022-02-25 12:17:48 +01:00
commit 27053bfeab
5 files changed
+9 -39

No files matched your search

@@ -131,7 +131,7 @@ public class RecipeHandlerBrewery extends TemplateRecipeHandler {
continue;
CachedBreweryRecipe crecipe = new CachedBreweryRecipe(recipe);
if(crecipe.contains(crecipe.inputs, ingredient))
if(crecipe.containsWithNBT(crecipe.inputs, ingredient))
arecipes.add(crecipe);
}
}
@@ -131,7 +131,7 @@ public class RecipeHandlerElvenTrade extends TemplateRecipeHandler {
if(recipe == null)
continue;
if(NEIServerUtils.areStacksSameTypeCrafting(recipe.getOutput(), result))
if(NEIServerUtils.areStacksSameTypeCraftingWithNBT(recipe.getOutput(), result))
arecipes.add(new CachedElvenTradeRecipe(recipe));
}
}
@@ -145,7 +145,7 @@ public class RecipeHandlerElvenTrade extends TemplateRecipeHandler {
continue;
CachedElvenTradeRecipe crecipe = new CachedElvenTradeRecipe(recipe);
if(crecipe.contains(crecipe.inputs, ingredient))
if(crecipe.containsWithNBT(crecipe.inputs, ingredient))
arecipes.add(crecipe);
}
}
@@ -66,25 +66,6 @@ public class RecipeHandlerManaPool extends TemplateRecipeHandler {
return otherStacks;
}
@Override
public boolean contains(Collection<PositionedStack> ingredients, ItemStack ingredient) {
if(ingredients == inputs) {
boolean skippedPool = false;
for(PositionedStack stack : ingredients) {
if(!skippedPool) {
skippedPool = true;
continue;
}
if(stack.contains(ingredient))
return true;
}
}
return super.contains(ingredients, ingredient);
}
}
@Override
@@ -136,7 +117,7 @@ public class RecipeHandlerManaPool extends TemplateRecipeHandler {
if(recipe == null)
continue;
if(NEIServerUtils.areStacksSameTypeCrafting(recipe.getOutput(), result))
if(NEIServerUtils.areStacksSameTypeCraftingWithNBT(recipe.getOutput(), result))
arecipes.add(new CachedManaPoolRecipe(recipe));
}
}
@@ -148,7 +129,7 @@ public class RecipeHandlerManaPool extends TemplateRecipeHandler {
continue;
CachedManaPoolRecipe crecipe = new CachedManaPoolRecipe(recipe);
if(crecipe.contains(crecipe.getIngredients(), ingredient) || crecipe.contains(crecipe.getOtherStacks(), ingredient))
if(crecipe.containsWithNBT(crecipe.getIngredients(), ingredient) || crecipe.containsWithNBT(crecipe.getOtherStacks(), ingredient))
arecipes.add(crecipe);
}
}
@@ -121,7 +121,7 @@ public class RecipeHandlerPetalApothecary extends TemplateRecipeHandler {
if(recipe == null)
continue;
if(recipe.getOutput().stackTagCompound != null && NEIServerUtils.areStacksSameType(recipe.getOutput(), result) || recipe.getOutput().stackTagCompound == null && NEIServerUtils.areStacksSameTypeCrafting(recipe.getOutput(), result) && recipe.getOutput().getItem() != Items.skull)
if(recipe.getOutput().stackTagCompound != null && NEIServerUtils.areStacksSameTypeWithNBT(recipe.getOutput(), result) || recipe.getOutput().stackTagCompound == null && NEIServerUtils.areStacksSameTypeCrafting(recipe.getOutput(), result) && recipe.getOutput().getItem() != Items.skull)
arecipes.add(getCachedRecipe(recipe));
}
}
@@ -133,7 +133,7 @@ public class RecipeHandlerPetalApothecary extends TemplateRecipeHandler {
continue;
CachedPetalApothecaryRecipe crecipe = getCachedRecipe(recipe);
if(crecipe.contains(crecipe.inputs, ingredient) && recipe.getOutput().getItem() != Items.skull)
if(crecipe.containsWithNBT(crecipe.inputs, ingredient) && recipe.getOutput().getItem() != Items.skull)
arecipes.add(crecipe);
}
}
@@ -57,17 +57,6 @@ public class RecipeHandlerPureDaisy extends TemplateRecipeHandler {
return otherStacks;
}
@Override
public boolean contains(Collection<PositionedStack> ingredients, ItemStack ingredient) {
if(ingredients == inputs) {
for(PositionedStack stack : ingredients)
if(stack.contains(ingredient))
return true;
}
return super.contains(ingredients, ingredient);
}
}
@Override
@@ -117,7 +106,7 @@ public class RecipeHandlerPureDaisy extends TemplateRecipeHandler {
if(recipe == null)
continue;
if(NEIServerUtils.areStacksSameTypeCrafting(new ItemStack(recipe.getOutput()), result))
if(NEIServerUtils.areStacksSameTypeCraftingWithNBT(new ItemStack(recipe.getOutput()), result))
arecipes.add(new CachedPureDaisyRecipe(recipe));
}
}
@@ -129,7 +118,7 @@ public class RecipeHandlerPureDaisy extends TemplateRecipeHandler {
continue;
CachedPureDaisyRecipe crecipe = new CachedPureDaisyRecipe(recipe);
if(crecipe.contains(crecipe.getIngredients(), ingredient) || crecipe.contains(crecipe.getOtherStacks(), ingredient))
if(crecipe.containsWithNBT(crecipe.getIngredients(), ingredient) || crecipe.containsWithNBT(crecipe.getOtherStacks(), ingredient))
arecipes.add(crecipe);
}
}