1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
|
public class ModRecipesProvider extends FabricRecipeProvider
{
private static final List<ItemConvertible> GA_FURNACE = List.of(ModItems.example_item);
public ModRecipesProvider(FabricDataOutput output, CompletableFuture<RegistryWrapper.WrapperLookup> registriesFuture)
{
super(output, registriesFuture);
}
@Override
protected RecipeGenerator getRecipeGenerator(RegistryWrapper.WrapperLookup wrapperLookup, RecipeExporter recipeExporter)
{
return new RecipeGenerator(wrapperLookup, recipeExporter)
{
public void generate()
{
//可逆配方
offerReversibleCompactingRecipes(RecipeCategory.MISC, ModItems.INGOT_GA, RecipeCategory.BUILDING_BLOCKS, ModBlocks.GA_BLOCK);
//熔炉
offerSmelting(GA_FURNACE, RecipeCategory.MISC, ModItems.INGOT_GA, 0.7f, 200, "ga_blast_furnace");
//高炉
offerBlasting(GA_FURNACE, RecipeCategory.MISC, ModItems.INGOT_GA, 0.7f, 100, "ga_blast_furnace");
//烟熏炉
offerFoodCookingRecipe("smoking", RecipeSerializer.SMOKING, SmokingRecipe::new,600, ModItems.RAW_GA, ModItems.INGOT_GA, 0.35f);
//篝火
offerFoodCookingRecipe("campfire_cooking", RecipeSerializer.CAMPFIRE_COOKING, CampfireCookingRecipe::new,600, ModItems.RAW_GA, ModItems.INGOT_GA, 0.35f);
//有序配方
createShaped(RecipeCategory.MISC, ModItems.GA_EXAMPLE)
.pattern("XXX")
.input('X',ModItems.INGOT_GA)
.criterion("has_ga_example",conditionsFromItem(ModItems.INGOT_GA))
.offerTo(exporter, RegistryKey.of(RegistryKeys.RECIPE, getRecipeIdentifier(Identifier.of(<yourMODID>, "ga_example"))));
//无序配方
createShapeless(RecipeCategory.MISC, Items.FLINT_AND_STEEL,1)
.input(ModItems.INGOT_GA)
.input(Items.IRON_INGOT)
.criterion("has_flint_steel",conditionsFromItem(ModItems.INGOT_GA))
.criterion("has_flint_steel",conditionsFromItem(Items.IRON_INGOT))
.offerTo(exporter,RegistryKey.of(RegistryKeys.RECIPE, getRecipeIdentifier(Identifier.of(<yourMODID>, "other_flint_and_steel"))));
}
};
}
@Override
public String getName()
{
return <yourMODID>;
}
}
|