<?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=Using_FriendlyByteBuf</id>
	<title>Using FriendlyByteBuf - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://forge.gemwire.uk/index.php?action=history&amp;feed=atom&amp;title=Using_FriendlyByteBuf"/>
	<link rel="alternate" type="text/html" href="https://forge.gemwire.uk/index.php?title=Using_FriendlyByteBuf&amp;action=history"/>
	<updated>2026-05-12T21:08:23Z</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=Using_FriendlyByteBuf&amp;diff=2868&amp;oldid=prev</id>
		<title>ChampionAsh5357: Update to 1.17</title>
		<link rel="alternate" type="text/html" href="https://forge.gemwire.uk/index.php?title=Using_FriendlyByteBuf&amp;diff=2868&amp;oldid=prev"/>
		<updated>2021-08-02T18:28:16Z</updated>

		<summary type="html">&lt;p&gt;Update to 1.17&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 18:28, 2 August 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-l1&quot; &gt;Line 1:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 1:&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;&amp;lt;code&amp;gt;&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;PacketBuffer&lt;/del&gt;&amp;lt;/code&amp;gt;s are essentially a byte array of zero or more bytes to sync information across a network. It works similarly to a queue: the information is written in to a specific order and read in the order it was written.&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;&amp;lt;code&amp;gt;&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;FriendlyByteBuf&lt;/ins&gt;&amp;lt;/code&amp;gt;s are essentially a byte array of zero or more bytes to sync information across a network. It works similarly to a queue: the information is written in to a specific order and read in the order it was written.&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;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;== Using &amp;lt;code&amp;gt;&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;PacketBuffer&lt;/del&gt;&amp;lt;/code&amp;gt;s ==&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;== Using &amp;lt;code&amp;gt;&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;FriendlyByteBuf&lt;/ins&gt;&amp;lt;/code&amp;gt;s ==&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;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;In most cases, one will use a premade &amp;lt;code&amp;gt;&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;PacketBuffer&lt;/del&gt;&amp;lt;/code&amp;gt; passed in from some network. Most of the time this is a heap buffer of some sort; however, understanding how it works is best left as an explanation of data structures.&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;In most cases, one will use a premade &amp;lt;code&amp;gt;&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;FriendlyByteBuf&lt;/ins&gt;&amp;lt;/code&amp;gt; passed in from some network. Most of the time this is a heap buffer of some sort; however, understanding how it works is best left as an explanation of data structures.&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;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;When you are &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;&amp;lt;code&amp;gt;&lt;/del&gt;writing&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;&amp;lt;/code&amp;gt; &lt;/del&gt;to a &amp;lt;code&amp;gt;&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;PacketBuffer&lt;/del&gt;&amp;lt;/code&amp;gt;, you are calling one of the many write functions to store information as bytes (e.g. &amp;lt;code&amp;gt;writeBlockPos&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;writeVarInt&amp;lt;/code&amp;gt;). There are a couple of helpers for objects like &amp;lt;code&amp;gt;&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;CompoundNBT&lt;/del&gt;&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;ItemStack&amp;lt;/code&amp;gt;s, etc. if they are needed.&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;When you are &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;'''&lt;/ins&gt;writing&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;''' &lt;/ins&gt;to a &amp;lt;code&amp;gt;&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;FriendlyByteBuf&lt;/ins&gt;&amp;lt;/code&amp;gt;, you are calling one of the many write functions to store information as bytes (e.g. &amp;lt;code&amp;gt;writeBlockPos&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;writeVarInt&amp;lt;/code&amp;gt;). There are a couple of helpers for objects like &amp;lt;code&amp;gt;&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;CompoundTag&lt;/ins&gt;&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;ItemStack&amp;lt;/code&amp;gt;s, etc. if they are needed.&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;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;When you are &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;&amp;lt;code&amp;gt;&lt;/del&gt;reading&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;&amp;lt;/code&amp;gt; &lt;/del&gt;from a &amp;lt;code&amp;gt;&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;PacketBuffer&lt;/del&gt;&amp;lt;/code&amp;gt;, you are calling the equivalent read function in the same order. For example, if you call &amp;lt;code&amp;gt;writeBlockPos&amp;lt;/code&amp;gt; and then &amp;lt;code&amp;gt;writeVarInt&amp;lt;/code&amp;gt;, you would call &amp;lt;code&amp;gt;readBlockPos&amp;lt;/code&amp;gt; and then &amp;lt;code&amp;gt;readVarInt&amp;lt;/code&amp;gt; in that order. Each of these method returns the value from the buffer.&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;When you are &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;'''&lt;/ins&gt;reading&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;''' &lt;/ins&gt;from a &amp;lt;code&amp;gt;&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;FriendlyByteBuf&lt;/ins&gt;&amp;lt;/code&amp;gt;, you are calling the equivalent read function in the same order. For example, if you call &amp;lt;code&amp;gt;writeBlockPos&amp;lt;/code&amp;gt; and then &amp;lt;code&amp;gt;writeVarInt&amp;lt;/code&amp;gt;, you would call &amp;lt;code&amp;gt;readBlockPos&amp;lt;/code&amp;gt; and then &amp;lt;code&amp;gt;readVarInt&amp;lt;/code&amp;gt; in that order. Each of these method returns the value from the buffer.&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=Using_FriendlyByteBuf&amp;diff=2866&amp;oldid=prev</id>
		<title>ChampionAsh5357: ChampionAsh5357 moved page Using PacketBuffer to Using FriendlyByteBuf: Class rename</title>
		<link rel="alternate" type="text/html" href="https://forge.gemwire.uk/index.php?title=Using_FriendlyByteBuf&amp;diff=2866&amp;oldid=prev"/>
		<updated>2021-08-02T18:26:48Z</updated>

		<summary type="html">&lt;p&gt;ChampionAsh5357 moved page &lt;a href=&quot;/wiki/Using_PacketBuffer&quot; class=&quot;mw-redirect&quot; title=&quot;Using PacketBuffer&quot;&gt;Using FriendlyByteBuf&lt;/a&gt; to &lt;a href=&quot;/wiki/Using_FriendlyByteBuf&quot; title=&quot;Using FriendlyByteBuf&quot;&gt;Using FriendlyByteBuf&lt;/a&gt;: Class rename&lt;/p&gt;
&lt;table class=&quot;diff diff-contentalign-left diff-editfont-monospace&quot; data-mw=&quot;interface&quot;&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en-GB&quot;&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 18:26, 2 August 2021&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-notice&quot; lang=&quot;en-GB&quot;&gt;&lt;div class=&quot;mw-diff-empty&quot;&gt;(No difference)&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=Using_FriendlyByteBuf&amp;diff=2181&amp;oldid=prev</id>
		<title>Unbekannt: Created page with &quot;&lt;code&gt;PacketBuffer&lt;/code&gt;s are essentially a byte array of zero or more bytes to sync information across a network. It works similarly to a queue: the information is written i...&quot;</title>
		<link rel="alternate" type="text/html" href="https://forge.gemwire.uk/index.php?title=Using_FriendlyByteBuf&amp;diff=2181&amp;oldid=prev"/>
		<updated>2020-10-25T12:35:39Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot;&amp;lt;code&amp;gt;PacketBuffer&amp;lt;/code&amp;gt;s are essentially a byte array of zero or more bytes to sync information across a network. It works similarly to a queue: the information is written i...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;&amp;lt;code&amp;gt;PacketBuffer&amp;lt;/code&amp;gt;s are essentially a byte array of zero or more bytes to sync information across a network. It works similarly to a queue: the information is written in to a specific order and read in the order it was written.&lt;br /&gt;
&lt;br /&gt;
== Using &amp;lt;code&amp;gt;PacketBuffer&amp;lt;/code&amp;gt;s ==&lt;br /&gt;
&lt;br /&gt;
In most cases, one will use a premade &amp;lt;code&amp;gt;PacketBuffer&amp;lt;/code&amp;gt; passed in from some network. Most of the time this is a heap buffer of some sort; however, understanding how it works is best left as an explanation of data structures.&lt;br /&gt;
&lt;br /&gt;
When you are &amp;lt;code&amp;gt;writing&amp;lt;/code&amp;gt; to a &amp;lt;code&amp;gt;PacketBuffer&amp;lt;/code&amp;gt;, you are calling one of the many write functions to store information as bytes (e.g. &amp;lt;code&amp;gt;writeBlockPos&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;writeVarInt&amp;lt;/code&amp;gt;). There are a couple of helpers for objects like &amp;lt;code&amp;gt;CompoundNBT&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;ItemStack&amp;lt;/code&amp;gt;s, etc. if they are needed.&lt;br /&gt;
&lt;br /&gt;
When you are &amp;lt;code&amp;gt;reading&amp;lt;/code&amp;gt; from a &amp;lt;code&amp;gt;PacketBuffer&amp;lt;/code&amp;gt;, you are calling the equivalent read function in the same order. For example, if you call &amp;lt;code&amp;gt;writeBlockPos&amp;lt;/code&amp;gt; and then &amp;lt;code&amp;gt;writeVarInt&amp;lt;/code&amp;gt;, you would call &amp;lt;code&amp;gt;readBlockPos&amp;lt;/code&amp;gt; and then &amp;lt;code&amp;gt;readVarInt&amp;lt;/code&amp;gt; in that order. Each of these method returns the value from the buffer.&lt;/div&gt;</summary>
		<author><name>Unbekannt</name></author>
	</entry>
</feed>