1919import net .minecraft .tags .TagKey ;
2020import net .minecraft .world .item .Item ;
2121import net .minecraft .world .item .ItemStack ;
22- import net .minecraft .world .item .crafting .Ingredient ;
23- import net .minecraftforge .common .crafting .IntersectionIngredient ;
2422
2523import it .unimi .dsi .fastutil .objects .ObjectIntPair ;
2624import org .jetbrains .annotations .NotNull ;
@@ -46,9 +44,7 @@ public static void run(@NotNull Consumer<FinishedRecipe> provider, @NotNull Mate
4644 }
4745
4846 for (TagPrefix ore : ORES .keySet ()) {
49- if (ConfigHolder .INSTANCE .worldgen .allUniqueStoneTypes || ORES .get (ore ).shouldDropAsItem ()) {
50- processOre (provider , ore , property , material );
51- }
47+ processOre (provider , ore , property , material );
5248 }
5349
5450 processRawOre (provider , property , material );
@@ -81,6 +77,8 @@ private static void processOre(@NotNull Consumer<FinishedRecipe> provider, @NotN
8177 return ;
8278 }
8379
80+ var inputStack = ChemicalHelper .get (orePrefix , material );
81+
8482 Material byproductMaterial = property .getOreByProduct (0 , material );
8583 ItemStack byproductStack = ChemicalHelper .get (gem , byproductMaterial );
8684 if (byproductStack .isEmpty ()) {
@@ -106,29 +104,28 @@ private static void processOre(@NotNull Consumer<FinishedRecipe> provider, @NotN
106104
107105 String prefixString = orePrefix == ore ? "" : orePrefix .name + "_" ;
108106 if (!crushedStack .isEmpty ()) {
107+ int crushedCount = property .getOreMultiplier () * oreTypeMultiplier ;
109108 GTRecipeBuilder builder = FORGE_HAMMER_RECIPES
110109 .recipeBuilder ("hammer_" + prefixString + material .getName () + "_ore_to_crushed_ore" )
111- .inputItems (IntersectionIngredient . of ( Ingredient . of ( orePrefix . getItemTags ( material )[ 0 ]),
112- Ingredient . of ( orePrefix . getItemParentTags ()[ 0 ])) )
113- .category ( GTRecipeCategories . ORE_FORGING )
114- .duration ( 10 ). EUt ( 16 );
110+ .inputItems (inputStack )
111+ . EUt ( 16 )
112+ .duration ( 10 )
113+ .category ( GTRecipeCategories . ORE_FORGING );
115114 if (material .hasProperty (PropertyKey .GEM ) && !ChemicalHelper .get (gem , material ).isEmpty ()) {
116- builder .outputItems (ChemicalHelper .get (gem , material )
117- .copyWithCount (property .getOreMultiplier () * oreTypeMultiplier ));
115+ builder .outputItems (ChemicalHelper .get (gem , material ).copyWithCount (crushedCount ));
118116 } else {
119- builder .outputItems (crushedStack .copyWithCount (property . getOreMultiplier () * oreTypeMultiplier ));
117+ builder .outputItems (crushedStack .copyWithCount (crushedCount ));
120118 }
121119 builder .save (provider );
122120
123121 builder = MACERATOR_RECIPES
124122 .recipeBuilder ("macerate_" + prefixString + material .getName () + "_ore_to_crushed_ore" )
125- .inputItems (IntersectionIngredient .of (Ingredient .of (orePrefix .getItemTags (material )[0 ]),
126- Ingredient .of (orePrefix .getItemParentTags ()[0 ])))
127- .outputItems (crushedStack .copyWithCount (property .getOreMultiplier () * 2 * oreTypeMultiplier ))
123+ .inputItems (inputStack )
124+ .outputItems (crushedStack .copyWithCount (crushedCount * 2 ))
128125 .chancedOutput (byproductStack , 1400 , 0 )
129126 .EUt (2 )
130- .category ( GTRecipeCategories . ORE_CRUSHING )
131- .duration ( 400 );
127+ .duration ( 400 )
128+ .category ( GTRecipeCategories . ORE_CRUSHING );
132129
133130 for (MaterialStack secondaryMaterial : orePrefix .secondaryMaterials ()) {
134131 if (secondaryMaterial .material ().hasProperty (PropertyKey .DUST )) {
@@ -144,14 +141,10 @@ private static void processOre(@NotNull Consumer<FinishedRecipe> provider, @NotN
144141 if (!ingotStack .isEmpty () && doesMaterialUseNormalFurnace (smeltingMaterial ) && !orePrefix .isIgnored (material )) {
145142 float xp = Math .round (((1 + oreTypeMultiplier * 0.5f ) * 0.5f - 0.05f ) * 10f ) / 10f ;
146143 VanillaRecipeHelper .addSmeltingRecipe (provider ,
147- "smelt_" + prefixString + material .getName () + "_ore_to_ingot" ,
148- IntersectionIngredient .of (Ingredient .of (orePrefix .getItemTags (material )[0 ]),
149- Ingredient .of (orePrefix .getItemParentTags ()[0 ])),
144+ "smelt_" + prefixString + material .getName () + "_ore_to_ingot" , inputStack ,
150145 ingotStack , xp );
151146 VanillaRecipeHelper .addBlastingRecipe (provider ,
152- "smelt_" + prefixString + material .getName () + "_ore_to_ingot" ,
153- IntersectionIngredient .of (Ingredient .of (orePrefix .getItemTags (material )[0 ]),
154- Ingredient .of (orePrefix .getItemParentTags ()[0 ])),
147+ "smelt_" + prefixString + material .getName () + "_ore_to_ingot" , inputStack ,
155148 ingotStack , xp );
156149 }
157150 }
@@ -207,13 +200,6 @@ private static void processRawOre(@NotNull Consumer<FinishedRecipe> provider, @N
207200 .category (GTRecipeCategories .ORE_CRUSHING )
208201 .duration (400 );
209202
210- for (MaterialStack secondaryMaterial : ore .secondaryMaterials ()) {
211- if (secondaryMaterial .material ().hasProperty (PropertyKey .DUST )) {
212- ItemStack dustStack = ChemicalHelper .getGem (secondaryMaterial );
213- builder .chancedOutput (dustStack , 6700 , 0 );
214- }
215- }
216-
217203 builder .save (provider );
218204 }
219205
0 commit comments