<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en-GB">
	<id>https://forge.gemwire.uk/index.php?action=history&amp;feed=atom&amp;title=Custom_Recipes%2F1.16</id>
	<title>Custom Recipes/1.16 - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://forge.gemwire.uk/index.php?action=history&amp;feed=atom&amp;title=Custom_Recipes%2F1.16"/>
	<link rel="alternate" type="text/html" href="https://forge.gemwire.uk/index.php?title=Custom_Recipes/1.16&amp;action=history"/>
	<updated>2026-04-30T16:07:24Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.35.0</generator>
	<entry>
		<id>https://forge.gemwire.uk/index.php?title=Custom_Recipes/1.16&amp;diff=2959&amp;oldid=prev</id>
		<title>ChampionAsh5357: Add missing bracket</title>
		<link rel="alternate" type="text/html" href="https://forge.gemwire.uk/index.php?title=Custom_Recipes/1.16&amp;diff=2959&amp;oldid=prev"/>
		<updated>2021-09-25T21:27:01Z</updated>

		<summary type="html">&lt;p&gt;Add missing bracket&lt;/p&gt;
&lt;table class=&quot;diff diff-contentalign-left diff-editfont-monospace&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en-GB&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 21:27, 25 September 2021&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l106&quot; &gt;Line 106:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 106:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;! Method !! Description&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;! Method !! Description&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;|-&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;|-&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;| getId || This gets the id of the recipe. When serialized, the recipe will be saved to &amp;lt;code&amp;gt;data/&amp;lt;namespace&amp;gt;/recipes/&amp;lt;path&amp;gt;.json&amp;lt;/code.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;| getId || This gets the id of the recipe. When serialized, the recipe will be saved to &amp;lt;code&amp;gt;data/&amp;lt;namespace&amp;gt;/recipes/&amp;lt;path&amp;gt;.json&amp;lt;/code&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;&amp;gt;&lt;/ins&gt;.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;|-&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;|-&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;| getType || This gets the &amp;lt;code&amp;gt;IRecipeSerializer&amp;lt;/code&amp;gt; of the recipe. The registry name is set to the &amp;lt;code&amp;gt;type&amp;lt;/code&amp;gt; field using this within &amp;lt;code&amp;gt;#serializeRecipe&amp;lt;/code&amp;gt;.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;| getType || This gets the &amp;lt;code&amp;gt;IRecipeSerializer&amp;lt;/code&amp;gt; of the recipe. The registry name is set to the &amp;lt;code&amp;gt;type&amp;lt;/code&amp;gt; field using this within &amp;lt;code&amp;gt;#serializeRecipe&amp;lt;/code&amp;gt;.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>ChampionAsh5357</name></author>
	</entry>
	<entry>
		<id>https://forge.gemwire.uk/index.php?title=Custom_Recipes/1.16&amp;diff=2957&amp;oldid=prev</id>
		<title>ChampionAsh5357: Improve overall documentation for custom recipes</title>
		<link rel="alternate" type="text/html" href="https://forge.gemwire.uk/index.php?title=Custom_Recipes/1.16&amp;diff=2957&amp;oldid=prev"/>
		<updated>2021-09-25T21:17:41Z</updated>

		<summary type="html">&lt;p&gt;Improve overall documentation for custom recipes&lt;/p&gt;
&lt;a href=&quot;https://forge.gemwire.uk/index.php?title=Custom_Recipes/1.16&amp;amp;diff=2957&amp;amp;oldid=2753&quot;&gt;Show changes&lt;/a&gt;</summary>
		<author><name>ChampionAsh5357</name></author>
	</entry>
	<entry>
		<id>https://forge.gemwire.uk/index.php?title=Custom_Recipes/1.16&amp;diff=2753&amp;oldid=prev</id>
		<title>ShrimpBot: Copy Custom Recipes to MC1.16 archive</title>
		<link rel="alternate" type="text/html" href="https://forge.gemwire.uk/index.php?title=Custom_Recipes/1.16&amp;diff=2753&amp;oldid=prev"/>
		<updated>2021-07-27T04:13:49Z</updated>

		<summary type="html">&lt;p&gt;Copy &lt;a href=&quot;/wiki/Custom_Recipes&quot; title=&quot;Custom Recipes&quot;&gt;Custom Recipes&lt;/a&gt; to MC1.16 archive&lt;/p&gt;
&lt;table class=&quot;diff diff-contentalign-left diff-editfont-monospace&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en-GB&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 04:13, 27 July 2021&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l6&quot; &gt;Line 6:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 6:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;==== IRecipeSerializer ====  &lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;==== IRecipeSerializer ====  &lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;The thing that actually serializes recipe files. It implements the vanilla recipe serializer interface and provides means of reading from JSON and performing read/write operations on network buffer objects. One should look into using [[Codecs/1.16]] for this class, as using them simplifies the logic significantly.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;The thing that actually serializes recipe files. It implements the vanilla recipe serializer interface and provides means of reading from JSON and performing read/write operations on network buffer objects. One should look into using [[Codecs/1.16&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;|Codecs&lt;/ins&gt;]] for this class, as using them simplifies the logic significantly.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>ShrimpBot</name></author>
	</entry>
	<entry>
		<id>https://forge.gemwire.uk/index.php?title=Custom_Recipes/1.16&amp;diff=2688&amp;oldid=prev</id>
		<title>ShrimpBot: Copy Custom Recipes to MC1.16 archive</title>
		<link rel="alternate" type="text/html" href="https://forge.gemwire.uk/index.php?title=Custom_Recipes/1.16&amp;diff=2688&amp;oldid=prev"/>
		<updated>2021-07-27T03:58:07Z</updated>

		<summary type="html">&lt;p&gt;Copy &lt;a href=&quot;/wiki/Custom_Recipes&quot; title=&quot;Custom Recipes&quot;&gt;Custom Recipes&lt;/a&gt; to MC1.16 archive&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;= Custom Recipe Serializers =&lt;br /&gt;
&lt;br /&gt;
Want to make a custom recipe type for a machine, or some mechanic your mod has? Great! It means users can participate in the datapack system for recipes, so you get automatic syncing, updating, and ease of maintenance on servers. Here's what you need to get started:&lt;br /&gt;
&lt;br /&gt;
== Classes/Interfaces for the inventories and serialization ==&lt;br /&gt;
&lt;br /&gt;
==== IRecipeSerializer ==== &lt;br /&gt;
The thing that actually serializes recipe files. It implements the vanilla recipe serializer interface and provides means of reading from JSON and performing read/write operations on network buffer objects. One should look into using [[Codecs/1.16]] for this class, as using them simplifies the logic significantly.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
public class MyRecipeSerializer &lt;br /&gt;
  extends ForgeRegistryEntry&amp;lt;IRecipeSerializer&amp;lt;?&amp;gt;&amp;gt; &lt;br /&gt;
  implements IRecipeSerializer&amp;lt;MyRecipeType&amp;gt; {&lt;br /&gt;
  &lt;br /&gt;
  // your serializer code here&lt;br /&gt;
&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== IRecipeType ====&lt;br /&gt;
Links the recipe type to its implementation class. This is a very lightweight class that vanilla uses to make a recipe file's &amp;lt;code&amp;gt;type&amp;lt;/code&amp;gt; line to which serializer should be used to deserialize a recipe into an instance.&lt;br /&gt;
&lt;br /&gt;
==== IInventory ====&lt;br /&gt;
Wraps vanilla's &amp;lt;code&amp;gt;IInventory&amp;lt;/code&amp;gt; system. [https://gist.github.com/robotgryphon/344e5815e27f28fef7a837c4f98ade40 Here's a reference.] '''''Note this should not be used directly; you should make a fake inventory class and handle the actual match implementation with your own methods and logic.'''''&lt;br /&gt;
&lt;br /&gt;
==== IRecipe ====&lt;br /&gt;
Your actual recipe class or an abstraction to cheat vanilla's system and use your own recipe matching system. Takes the &amp;lt;code&amp;gt;IInventory&amp;lt;/code&amp;gt; from above and matches it. Your recipe class should return the &amp;lt;code&amp;gt;IRecipeType&amp;lt;/code&amp;gt; from registration in the getType override.&lt;br /&gt;
&lt;br /&gt;
== Setup ==&lt;br /&gt;
Once you have the above implementations, here's how to wire everything up:&lt;br /&gt;
&lt;br /&gt;
# Register your recipe serializer to the &amp;lt;code&amp;gt;RECIPE_SERIALIZERS&amp;lt;/code&amp;gt; Forge registry.&lt;br /&gt;
# Register the recipe type during the registration (constructor) phase. See below.&lt;br /&gt;
# Place a JSON file in &amp;lt;code&amp;gt;data/recipes/my_recipe.json&amp;lt;/code&amp;gt; and ensure it has &amp;lt;code&amp;gt;&amp;quot;type&amp;quot;: &amp;quot;mymod:my_recipe_type&amp;quot;&amp;lt;/code&amp;gt; in the JSON structure. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
Registry.register(Registry.RECIPE_TYPE, new ResLoc('mymod:my_recipe_type'), MyRecipeType.class);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This will load the recipe using the recipe serialization system, and wire it back to the serializer via matching the registry name in &amp;lt;code&amp;gt;type&amp;lt;/code&amp;gt; to the value you specified while registering the serializer in step 1.&lt;/div&gt;</summary>
		<author><name>ShrimpBot</name></author>
	</entry>
</feed>