11package mrbysco .constructionstick .data .server ;
22
3+ import mrbysco .constructionstick .data .server .recipe .IngredientPredicate ;
34import mrbysco .constructionstick .data .server .recipe .SmithingApplyUpgradeRecipeBuilder ;
45import mrbysco .constructionstick .items .stick .ItemStick ;
56import mrbysco .constructionstick .items .template .ItemUpgradeTemplate ;
@@ -30,22 +31,22 @@ public RecipeGenerator(PackOutput packOutput, CompletableFuture<HolderLookup.Pro
3031
3132 @ Override
3233 protected void buildRecipes (RecipeOutput output , HolderLookup .Provider provider ) {
33- stickRecipe (output , ModItems .STICK_WOODEN .get (), Inp .fromTag (Tags .Items .RODS_WOODEN ));
34- stickRecipe (output , ModItems .STICK_COPPER .get (), Inp .fromTag (ItemTags .STONE_TOOL_MATERIALS ));
35- stickRecipe (output , ModItems .STICK_IRON .get (), Inp .fromTag (Tags .Items .INGOTS_IRON ));
36- stickRecipe (output , ModItems .STICK_DIAMOND .get (), Inp .fromTag (Tags .Items .GEMS_DIAMOND ));
37- stickRecipe (output , ModItems .STICK_NETHERITE .get (), Inp .fromTag (Tags .Items .INGOTS_NETHERITE ));
34+ stickRecipe (output , ModItems .STICK_WOODEN .get (), IngredientPredicate .fromTag (Tags .Items .RODS_WOODEN ));
35+ stickRecipe (output , ModItems .STICK_COPPER .get (), IngredientPredicate .fromTag (ItemTags .STONE_TOOL_MATERIALS ));
36+ stickRecipe (output , ModItems .STICK_IRON .get (), IngredientPredicate .fromTag (Tags .Items .INGOTS_IRON ));
37+ stickRecipe (output , ModItems .STICK_DIAMOND .get (), IngredientPredicate .fromTag (Tags .Items .GEMS_DIAMOND ));
38+ stickRecipe (output , ModItems .STICK_NETHERITE .get (), IngredientPredicate .fromTag (Tags .Items .INGOTS_NETHERITE ));
3839
39- templateRecipe (output , ModItems .TEMPLATE_ANGEL .get (), Inp .fromTag (Tags .Items .FEATHERS ), Inp .fromTag (Tags .Items .INGOTS_GOLD ));
40- templateRecipe (output , ModItems .TEMPLATE_DESTRUCTION .get (), Inp .fromItem (Items .TNT ), Inp .fromItem (Items .DIAMOND_PICKAXE ));
40+ templateRecipe (output , ModItems .TEMPLATE_ANGEL .get (), IngredientPredicate .fromTag (Tags .Items .FEATHERS ), IngredientPredicate .fromTag (Tags .Items .INGOTS_GOLD ));
41+ templateRecipe (output , ModItems .TEMPLATE_DESTRUCTION .get (), IngredientPredicate .fromItem (Items .TNT ), IngredientPredicate .fromItem (Items .DIAMOND_PICKAXE ));
4142
42- templateUpgradeRecipe (output , ModItems .TEMPLATE_ANGEL , Inp .fromTag (Tags .Items .FEATHERS ), ModDataComponents .ANGEL , true );
43- templateUpgradeRecipe (output , ModItems .TEMPLATE_DESTRUCTION , Inp .fromTag (Tags .Items .STORAGE_BLOCKS_REDSTONE ), ModDataComponents .DESTRUCTION , true );
44- templateUpgradeRecipe (output , ModItems .TEMPLATE_UNBREAKABLE , Inp .fromTag (Tags .Items .OBSIDIANS_CRYING ), ModDataComponents .UNBREAKABLE , true );
45- templateUpgradeRecipe (output , ModItems .TEMPLATE_BATTERY , Inp .fromTag (Tags .Items .STORAGE_BLOCKS_COPPER ), ModDataComponents .BATTERY , 0 );
43+ templateUpgradeRecipe (output , ModItems .TEMPLATE_ANGEL , IngredientPredicate .fromTag (Tags .Items .FEATHERS ), ModDataComponents .ANGEL , true );
44+ templateUpgradeRecipe (output , ModItems .TEMPLATE_DESTRUCTION , IngredientPredicate .fromTag (Tags .Items .STORAGE_BLOCKS_REDSTONE ), ModDataComponents .DESTRUCTION , true );
45+ templateUpgradeRecipe (output , ModItems .TEMPLATE_UNBREAKABLE , IngredientPredicate .fromTag (Tags .Items .OBSIDIANS_CRYING ), ModDataComponents .UNBREAKABLE , true );
46+ templateUpgradeRecipe (output , ModItems .TEMPLATE_BATTERY , IngredientPredicate .fromTag (Tags .Items .STORAGE_BLOCKS_COPPER ), ModDataComponents .BATTERY_ENABLED , true );
4647 }
4748
48- private void stickRecipe (RecipeOutput output , ItemLike stick , Inp material ) {
49+ private void stickRecipe (RecipeOutput output , ItemLike stick , IngredientPredicate material ) {
4950 ShapedRecipeBuilder .shaped (RecipeCategory .TOOLS , stick )
5051 .define ('X' , material .ingredient ())
5152 .define ('#' , Tags .Items .RODS_WOODEN )
@@ -57,7 +58,7 @@ private void stickRecipe(RecipeOutput output, ItemLike stick, Inp material) {
5758 }
5859
5960 private <T > void templateUpgradeRecipe (RecipeOutput output , DeferredItem <? extends ItemUpgradeTemplate > template ,
60- Inp item1 , Supplier <DataComponentType <T >> component , T defaultValue ) {
61+ IngredientPredicate item1 , Supplier <DataComponentType <T >> component , T defaultValue ) {
6162 for (DeferredItem <? extends ItemStick > stickHolder : ModItems .STICKS ) {
6263 ItemStack stack = stickHolder .toStack ();
6364 stack .set (component , defaultValue );
@@ -71,7 +72,7 @@ private <T> void templateUpgradeRecipe(RecipeOutput output, DeferredItem<? exten
7172
7273 }
7374
74- private void templateRecipe (RecipeOutput output , ItemLike template , Inp item1 , Inp item2 ) {
75+ private void templateRecipe (RecipeOutput output , ItemLike template , IngredientPredicate item1 , IngredientPredicate item2 ) {
7576 ShapedRecipeBuilder .shaped (RecipeCategory .MISC , template )
7677 .define ('O' , item1 .ingredient ())
7778 .define ('X' , item2 .ingredient ())
0 commit comments