Posted July 26, 20223 yr I have a custom crafting table block, Foundry, with slots arranged in a ring formation. There is a also a slot I use for a tool that gets hurt upon use. Spoiler public FoundryMenu(int pContainerId, Inventory inv, BlockEntity entity, ContainerData data) { super(Registration.FOUNDRY_MENU.get(), pContainerId); checkContainerSize(inv, 8); blockEntity= ((FoundryBE) entity); this.level = inv.player.level; this.data = data; addPlayerInventory(inv); addPlayerHotbar(inv); this.blockEntity.getCapability(CapabilityItemHandler.ITEM_HANDLER_CAPABILITY).ifPresent(handler -> { this.addSlot(new SlotItemHandler(handler, 0, 9, 34)); this.addSlot(new SlotItemHandler(handler, 1, 80, 8)); this.addSlot(new SlotItemHandler(handler, 2, 107, 22)); this.addSlot(new SlotItemHandler(handler, 3, 107, 48)); this.addSlot(new SlotItemHandler(handler, 4, 80, 60)); this.addSlot(new SlotItemHandler(handler, 5, 51, 48)); this.addSlot(new SlotItemHandler(handler, 6, 51, 22)); this.addSlot(new KanResultSlot(handler, 7, 153, 32)); }); addDataSlots(data); } I have set up a custom recipe class also - https://github.com/Mattah12/Kanohi_Craft2022/blob/master/src/main/java/com/Mattah12/kanohicraft/recipes/FoundryRecipe.java What I want to know is how I'd go about making a datagen class for this custom recipe type? My plans will require a lot of possible recipes so I don't want to have to manually create all the jsons. I already have datagen set up for vanilla crafting, but can't get my head around how I go about creating the pattern. - https://github.com/Mattah12/Kanohi_Craft2022/blob/master/src/main/java/com/Mattah12/kanohicraft/datagen/KanRecipes.java Can that be done in the existing KanRecipes class? Would it require a new one? Edited July 26, 20223 yr by Mattah12 Added version
July 26, 20223 yr You need your own RecipeBuilder like vanilla has for its recipes. Boilerplate: If you don't post your logs/debug.log we can't help you. For curseforge you need to enable the forge debug.log in its minecraft settings. You should also post your crash report if you have one. If there is no error in the log file and you don't have a crash report then post the launcher_log.txt from the minecraft folder. Again for curseforge this will be in your curseforge/minecraft/Install Large files should be posted to a file sharing site like https://gist.github.com You should also read the support forum sticky post.
July 26, 20223 yr Why did you use ifPresent? Did you assume that your capability is not always present? Edited July 26, 20223 yr by Luis_ST
July 26, 20223 yr Author 20 minutes ago, warjort said: You need your own RecipeBuilder like vanilla has for its recipes. I'll have a peruse through that then thanks.
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.