Jump to content

[1.18.2] Custom Crafting Table


Symbols97
 Share

Recommended Posts

I want to make a custom crafting table for 1.18.2. I have done this with 1.7.10 but Im lost in the new version. I have used these videos to get where I am: 

 and 

 I want to make a crafting bench like vanilla (3x3), however I need the code to be able to use shaped and shapeless (if possible, if not just shaped is okay). And I want to be able to use this code to make other benches 2x2 or 5x5. Figured if I got a vanilla type 3x3 working I could modify the file to whatever else I would need. Here is the GitHub: https://github.com/Symbols97/1.18.2-OPWeapons-github/blob/main/OPWeapons/src/main/java/com/Symbols97/OPWeapons

I know the Matches method is wrong and I think my fromJson method. Not sure where to go though. A point in the right direction or a reference would be greatly appreciated. 

Link to comment
Share on other sites

  • Registry entries must not be created in static initializers. It is highly recommended to use DeferredRegister for all registration. This affects your RecipeType as well as your recipe serializer.
  • What is the actual issue you have currently?
Link to comment
Share on other sites

8 hours ago, diesieben07 said:
  • What is the actual issue you have currently?

Well clearly what I have doesn't serve my purposes. There isn't much online about making a custom crafting table (at least not that I could find). The matches method searches one index instead of a 3x3 and I see that the ShapedCrafting class has 3 methods for getting json inputs. I haven't been able to successfully mimic these. Currently nothing happens in the crafting table, it opens but no inputs produce an output. I assumed it was just my matches method and json method but I don't know exactly. 

 

Link to comment
Share on other sites

I am not really following what you are asking? Let me "guess".

You have a custom recipe, but you also want to reference "standard patterns".

By standard patterns do you mean ShapelessRecipe and ShapedRecipe used by the vanilla crafting station?

If you want to understand how the vanilla crafting table works look at vanilla's CraftingMenu, CraftingScreen and their related classes.

In particular CraftingMenu.slotChangedCraftingGrid() is where it uses the RecipeManager to locate recipes of RecipeType.CRAFTING

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

2 hours ago, warjort said:

I am not really following what you are asking? Let me "guess".

You have a custom recipe, but you also want to reference "standard patterns".

By standard patterns do you mean ShapelessRecipe and ShapedRecipe used by the vanilla crafting station?

Yeah basically. Just trying to make a normal 3x3 custom crafting table.

2 hours ago, warjort said:

If you want to understand how the vanilla crafting table works look at vanilla's CraftingMenu, CraftingScreen and their related classes.

In particular CraftingMenu.slotChangedCraftingGrid() is where it uses the RecipeManager to locate recipes of RecipeType.CRAFTING

I looked at those and tried to apply them but I'm struggling.

 

Who knew that when porting my 1.7.10 mod to 1.18.2 I'd get stuck on crafting tables, lol. 

Link to comment
Share on other sites

The mod that springs to mind for me is: https://github.com/BlakeBr0/ExtendedCrafting

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
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.

 Share



×
×
  • Create New...

Important Information

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