Jump to content

SpideyMagma

Members
  • Posts

    8
  • Joined

  • Last visited

Everything posted by SpideyMagma

  1. So umm... I approached tyhe code with a fresh mind today, and it turns out, I was just being dumb, you see, to get the ".define" tag to work pSymbol needs to be encased in 'exampleSymbol' not "exampleSymbol", I put this out here for anyone who might have run into the same problem.
  2. Okay, here is the full class package com.alexisotter.star_valley.datagen; import com.alexisotter.star_valley.StarValley; import com.alexisotter.star_valley.block.ModBlocks; import com.alexisotter.star_valley.item.custom.ModItems; import net.minecraft.data.PackOutput; import net.minecraft.data.recipes.*; import net.minecraft.world.item.Items; import net.minecraft.world.item.crafting.AbstractCookingRecipe; import net.minecraft.world.item.crafting.Ingredient; import net.minecraft.world.item.crafting.RecipeSerializer; import net.minecraft.world.level.ItemLike; import net.minecraftforge.common.crafting.conditions.IConditionBuilder; import java.util.List; import java.util.function.Consumer; public class ModRecipeProvider extends RecipeProvider implements IConditionBuilder { private static final List<ItemLike> STEEL_SMELTABLE = List.of(ModItems.STEEL_ALLOY_POWDER.get(), ModBlocks.DEEPSLATE_STEEL_ORE.get()); public ModRecipeProvider(PackOutput pOutput) { super(pOutput); } @Override protected void buildRecipes(Consumer<FinishedRecipe> pWriter) { oreSmelting(pWriter, STEEL_SMELTABLE, RecipeCategory.MISC, ModItems.STEEL_INGOT.get(), 0.35f, 300, "steel"); oreBlasting(pWriter, STEEL_SMELTABLE, RecipeCategory.MISC, ModItems.STEEL_INGOT.get(), 0.35f, 150, "steel"); ShapedRecipeBuilder.shaped(RecipeCategory.MISC, ModItems.STEEL_ALLOY_POWDER.get()) .pattern("CCC") .pattern("III") .pattern("III") .define("I", Items.IRON_INGOT) .define("C", Items.COAL) .unlockedBy(getHasName(Items.IRON_INGOT), has(Items.IRON_INGOT)) .save(pWriter); } protected static void oreSmelting(Consumer<FinishedRecipe> pFinishedRecipeConsumer, List<ItemLike> pIngredients, RecipeCategory pCategory, ItemLike pResult, float pExperience, int pCookingTIme, String pGroup) { oreCooking(pFinishedRecipeConsumer, RecipeSerializer.SMELTING_RECIPE, pIngredients, pCategory, pResult, pExperience, pCookingTIme, pGroup, "_from_smelting"); } protected static void oreBlasting(Consumer<FinishedRecipe> pFinishedRecipeConsumer, List<ItemLike> pIngredients, RecipeCategory pCategory, ItemLike pResult, float pExperience, int pCookingTime, String pGroup) { oreCooking(pFinishedRecipeConsumer, RecipeSerializer.BLASTING_RECIPE, pIngredients, pCategory, pResult, pExperience, pCookingTime, pGroup, "_from_blasting"); } protected static void oreCooking(Consumer<FinishedRecipe> pFinishedRecipeConsumer, RecipeSerializer<? extends AbstractCookingRecipe> pCookingSerializer, List<ItemLike> pIngredients, RecipeCategory pCategory, ItemLike pResult, float pExperience, int pCookingTime, String pGroup, String pRecipeName) { for(ItemLike itemlike : pIngredients) { SimpleCookingRecipeBuilder.generic(Ingredient.of(itemlike), pCategory, pResult, pExperience, pCookingTime, pCookingSerializer).group(pGroup).unlockedBy(getHasName(itemlike), has(itemlike)).save(pFinishedRecipeConsumer, StarValley.MOD_ID + ":" + (pResult) + pRecipeName + "_" + getItemName(itemlike)); } } } here is what the log outputs in IntelliJ: C:\Users\Alexis \Modding\forge-1.20.1-47.2.0-star_valley\src\main\java\com\alexisotter\star_valley\datagen\ModRecipeProvider.java:34: error: no suitable method found for define(String,Item) .define("I", Items.IRON_INGOT) ^ method ShapedRecipeBuilder.define(Character,TagKey<Item>) is not applicable (argument mismatch; String cannot be converted to Character) method ShapedRecipeBuilder.define(Character,ItemLike) is not applicable (argument mismatch; String cannot be converted to Character) method ShapedRecipeBuilder.define(Character,Ingredient) is not applicable (argument mismatch; String cannot be converted to Character)
  3. I tried, but it didn't work, and now when I return to Mods own added items, it doesn't work either, I am just stunned, cause shapeless works either way, but shaped doesn't, I've looked through multiple tutorials showing the process of adding datagen to a mod, all of them use this method, but I don't know why it doesn't work from me, maybe I'm just dumb..
  4. So, I've been trying out coding a mof, these are some tests for what I can do with it, and now I am creating a RecipeProvider. I know java, but minecraft modding not exactly, I've seen people ask for recipe assist here, but none matched my problem, so before I show the code, I want to remind you that the same code works if I put in modded items, but with vanilla, it doesn't. Okay, here is the code: ShapedRecipeBuilder.shaped(RecipeCategory.MISC, ModItems.STEEL_ALLOY_POWDER.get(), 6) .pattern("###") .pattern("///") .pattern("///") .define("/", IRON_INGOT.get()) //here is the problem, it shows that Cannot resolve method ".get()" in Item .define("#", COAL.get()) //same here .requires(IRON_INGOT, COAL) .unlockedBy(getHasName(ModItems.STEEL_ALLOY_POWDER.get(), has(Items.IRON_INGOT.get(), Items.COAL.get()))) same problem here, and it only appears with Vanilla Items .save(pWriter); Maybe I am just blind, but does someone mind helping, cause I've been stuck finding a solution for 2 days. [Edit] I tried taking the ".get()" function off, cause it worked for ".requires" tag, it doesn't [Edit #2] The solution for given problem turns out to be, to encase the symbol in '/' not "/" afterwards everything should work perfectly!
  5. idk how to attach the whole log
  6. idk how to attach a whole reoprt
  7. I did, it technically is only for 36.1.0, but I've never had this problem of it not loading in any other modpack on forge 36.2.20, even in this modpack, it used to work, then I deleted modpack once cause I was bored of it. Now it won't load, there aren't any error messages with loading optifine without optiforge, it just refuses to load, it shows it will load 137 mods, optifine being 137th mod, but it just won't do it.
  8. So I have been playing forge and lately wanted to get shaders on forge, so I downloaded Optifine 1.16.5 G8 and it refuses to load, I also tried G7 same thing, I tried optiforge, nothing, just crashes with Java runtime configuration error. I don't know what to do, any tips?
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.