Posted January 18, 20214 yr I'm very new to modding (this is my first mod), so sorry if this seem stupid. I'm using data generators to generate my recipes and whenever I run them it doesn't give any errors, but it also fails to generate the recipes. My Code: package net.Pinary_Pi.my1stmod.data.recipes; import java.util.function.Consumer; import net.minecraft.data.IFinishedRecipe; import net.minecraft.data.RecipeProvider; import net.Pinary_Pi.gear.item.CraftingItems; import net.Pinary_Pi.my1stmod.setup.ModItems import net.Pinary_Pi.my1stmod.setup.ModTags; import net.minecraft.data.DataGenerator; import net.minecraft.data.ShapedRecipeBuilder; public class ModRecipesProvider extends RecipeProvider { public ModRecipesProvider(DataGenerator generatorIn) { super(generatorIn); } @Override protected void registerRecipes(Consumer<IFinishedRecipe> consumer) { ShapedRecipeBuilder.shapedRecipe(CraftingItems.STORAGE_BLOCKS_SILVER) .key('#', ModTags.Items.INGOTS_SILVER) .patternLine("###") .patternLine("###") .patternLine("###") .addCriterion("has item", hasItem(ModTags.Items.INGOTS_SILVER)) .build(consumer); ShapedRecipeBuilder.shapedRecipe(CraftingItems.INGOTS_SILVER, 9) .key('#', ModTags.Items.STORAGE_BLOCKS_SILVER) .patternLine("#") .addCriterion("has item", hasItem(ModTags.Items.STORAGE_BLOCKS_SILVER)) .build(consumer); } } I'm pretty sure I need to change the CraftingItems to something different, but everything else I put there causes an error that says "The method shapedRecipe(IItemProvider, int) in the type ShapedRecipeBuilder is not applicable for the arguments (RegistryObject<Item>, int). " I know I need to do something with IItemProvider, but I don't know how. CraftingItems is a library that someone named SilentChaos512 made that I saw him using in his mods; I tried to copy what he did with it and put it in my mod. I'm pretty sure I'm not using it correctly.
January 18, 20214 yr RegistryObject is a supplier that holds an item, use Supplier#get to get the Item where has already implemented IItemProvider.
January 18, 20214 yr Author 3 hours ago, poopoodice said: RegistryObject is a supplier that holds an item, use Supplier#get to get the Item where has already implemented IItemProvider. TYSSSM!! It means a lot to me that you helped!
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.