use of slimeknights.tconstruct.library.recipe.ingredient.MaterialIngredient in project TinkersConstruct by SlimeKnights.
the class IToolRecipeHelper method partRecipes.
/**
* Adds a recipe to craft a material item
* @param consumer Recipe consumer
* @param part Part to be crafted
* @param cast Part cast
* @param cost Part cost
* @param partFolder Folder for recipes
*/
default void partRecipes(Consumer<FinishedRecipe> consumer, IMaterialItem part, CastItemObject cast, int cost, String partFolder, String castFolder) {
String name = Objects.requireNonNull(part.asItem().getRegistryName()).getPath();
// Part Builder
PartRecipeBuilder.partRecipe(part).setPattern(modResource(name)).setPatternItem(CompoundIngredient.from(Ingredient.of(TinkerTags.Items.DEFAULT_PATTERNS), Ingredient.of(cast.get()))).setCost(cost).save(consumer, modResource(partFolder + "builder/" + name));
// Material Casting
String castingFolder = partFolder + "casting/";
MaterialCastingRecipeBuilder.tableRecipe(part).setItemCost(cost).setCast(cast.getMultiUseTag(), false).save(consumer, modResource(castingFolder + name + "_gold_cast"));
MaterialCastingRecipeBuilder.tableRecipe(part).setItemCost(cost).setCast(cast.getSingleUseTag(), true).save(consumer, modResource(castingFolder + name + "_sand_cast"));
CompositeCastingRecipeBuilder.table(part, cost).save(consumer, modResource(castingFolder + name + "_composite"));
// Cast Casting
MaterialIngredient ingredient = MaterialIngredient.fromItem(part);
castCreation(consumer, ingredient, cast, castFolder, Objects.requireNonNull(part.asItem().getRegistryName()).getPath());
}
Aggregations