Jump to content

[1.18.2] Datagen'ing custom recipe types?


Mattah12

Recommended Posts

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 by Mattah12
Added version
Link to comment
Share on other sites

  • Mattah12 changed the title to [1.18.2] Datagen'ing custom recipe types?

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.

Link to comment
Share on other sites

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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Announcements



×
×
  • Create New...

Important Information

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