Leaving recipes for planks for more advanced machinery
frakier opened this issue ยท 1 comments
Your mod removes all plank recipes, need a way to specify for more advanced machinery to keep their recipes for planks. Tried using data_packs but they get removed as well. I could have made this config option but so far the corail_woodcutter mod is the only machinery that collides with natural progression so i just hard coded it.
The change I made to the mod... on RecipeRemover.java starting at around line 103 I changed the method...
/**
* Removes all crafting recipes with an output item contained in the specified tag.
*
* @param recipeManager The recipe manager
* @param tag The tag
*/
private static void removeRecipes(final RecipeManager recipeManager, final Tag tag)
{
//this could be a config setting of pipe delineated mod ids
String validPattern = "(corail_woodcutter:)"; //Separate with "|" pipe symbol for or like so "(corail_woodcutter:|somemod:)"
//create the regex pattern here no use recreating it ever time
Pattern p = Pattern.compile(validPattern);
final int recipesRemoved = removeRecipes(recipeManager, recipe -> {
final ItemStack recipeOutput = recipe.getRecipeOutput();
//make the match on the reipe id
Matcher matcher = p.matcher(recipe.getId().toString());
//store the result in a variable
boolean found = matcher.find();
//add the && !found result to existing code
return !recipeOutput.isEmpty() && recipeOutput.getItem().isIn(tag)
&& !(recipe.getSerializer() instanceof DamageItemRecipe.Serializer) && !found;
});
NaturalProgression.getInstance().LOGGER.info("Removed {} recipe(s) for tag {}", recipesRemoved, tag.getId());
}
Thanks for your input but I think we have a better plan as discussed in #23 ๐