October 29, 20214 yr Good morning, so I'm currently in the process of converting my recipes to DataGeneration(1.7.x to 1.16.x). In the past I would simply copypasta groups of code blocks, primarily due to laziness and lack of time. I want to change that, and if it's just to render my code a little bit more professionell. I remember in the past you could "group up" item types by calling their material, but no matter how much I'm trying to convert this method, and browsing the Forge/MC Snapshot files, I don't think this method is available any more(correct me if I'm wrong). So, in code, here's what I mean: //I want to turn this... ShapelessRecipeBuilder.shapelessRecipe( Items.STRING) .addIngredient(Items.WHITE_WOOL, 2) .addCriterion("has_wool", hasItem(Items.WHITE_WOOL)).build(consumer); ShapelessRecipeBuilder.shapelessRecipe( Items.STRING) .addIngredient(Items.BLACK_WOOL, 2) .addCriterion("has_wool", hasItem(Items.BLACK_WOOL)).build(consumer); //...into something like this... ShapelessRecipeBuilder.shapelessRecipe( Items.STRING) .addIngredient((any)ItemType(of).WOOL, 2) .addCriterion("has_wool", hasItem((any)ItemType(of).WOOL)).build(consumer); Material, ItemType, or an ItemArray, what would you recommend? I'd need that info to actually browse the correct files. Edited October 29, 20214 yr by Cratthorax
October 29, 20214 yr Author Some of the recipe methods, like .smeltingRecipe(), won't compile without casting an IItemProvider argument in front of ItemTags.WOOL. Let me see if it does what's proposed.
October 29, 20214 yr Author And I don't know how to loop through ItemTags. Unfortunately a List.array would only work for strings. DF!
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.