Difference between revisions of "Template:Packet"

From wiki.vg
Jump to navigation Jump to search
(updated for current packet tables)
(removed thead and tbody tags, MediaWiki doesn't like those)
Line 1: Line 1:
<includeonly><table class="wikitable"><thead><tr><th>Packet ID</th><th>State</th><th>Bound to</th><th>Field name</th><th>Field type</th><th>Notes</th></tr></thead><!--
+
<includeonly><table class="wikitable"><tr><th>Packet ID</th><th>State</th><th>Bound to</th><th>Field name</th><th>Field type</th><th>Notes</th></tr><!--
  
--><tbody><tr><td rowspan="{{{rowspan|{{#if:{{{5|}}}|{{#if:{{{8|}}}|{{#if:{{{11|}}}|{{#if:{{{14|}}}|{{#if:{{{17|}}}|{{#if:{{{20|}}}|{{#if:{{{23|}}}|{{#if:{{{26|}}}|{{#if:{{{29|}}}|{{#if:{{{32|}}}|{{#if:{{{35|}}}|12|11}}|10}}|9}}|8}}|7}}|6}}|5}}|4}}|3}}|2}}|1}}}}}"><code>0x{{{id}}}</code></td><td rowspan="{{{rowspan|{{#if:{{{5|}}}|{{#if:{{{8|}}}|{{#if:{{{11|}}}|{{#if:{{{14|}}}|{{#if:{{{17|}}}|{{#if:{{{20|}}}|{{#if:{{{23|}}}|{{#if:{{{26|}}}|{{#if:{{{29|}}}|{{#if:{{{32|}}}|{{#if:{{{35|}}}|12|11}}|10}}|9}}|8}}|7}}|6}}|5}}|4}}|3}}|2}}|1}}}}}">{{{state}}}</td><td rowspan="{{{rowspan|{{#if:{{{5|}}}|{{#if:{{{8|}}}|{{#if:{{{11|}}}|{{#if:{{{14|}}}|{{#if:{{{17|}}}|{{#if:{{{20|}}}|{{#if:{{{23|}}}|{{#if:{{{26|}}}|{{#if:{{{29|}}}|{{#if:{{{32|}}}|{{#if:{{{35|}}}|12|11}}|10}}|9}}|8}}|7}}|6}}|5}}|4}}|3}}|2}}|1}}}}}">{{{bound}}}</td><td>{{{1}}}</td><td>{{{2}}}</td><td>{{{3|}}}</td></tr><!--
+
--><tr><td rowspan="{{{rowspan|{{#if:{{{5|}}}|{{#if:{{{8|}}}|{{#if:{{{11|}}}|{{#if:{{{14|}}}|{{#if:{{{17|}}}|{{#if:{{{20|}}}|{{#if:{{{23|}}}|{{#if:{{{26|}}}|{{#if:{{{29|}}}|{{#if:{{{32|}}}|{{#if:{{{35|}}}|12|11}}|10}}|9}}|8}}|7}}|6}}|5}}|4}}|3}}|2}}|1}}}}}"><code>0x{{{id}}}</code></td><td rowspan="{{{rowspan|{{#if:{{{5|}}}|{{#if:{{{8|}}}|{{#if:{{{11|}}}|{{#if:{{{14|}}}|{{#if:{{{17|}}}|{{#if:{{{20|}}}|{{#if:{{{23|}}}|{{#if:{{{26|}}}|{{#if:{{{29|}}}|{{#if:{{{32|}}}|{{#if:{{{35|}}}|12|11}}|10}}|9}}|8}}|7}}|6}}|5}}|4}}|3}}|2}}|1}}}}}">{{{state}}}</td><td rowspan="{{{rowspan|{{#if:{{{5|}}}|{{#if:{{{8|}}}|{{#if:{{{11|}}}|{{#if:{{{14|}}}|{{#if:{{{17|}}}|{{#if:{{{20|}}}|{{#if:{{{23|}}}|{{#if:{{{26|}}}|{{#if:{{{29|}}}|{{#if:{{{32|}}}|{{#if:{{{35|}}}|12|11}}|10}}|9}}|8}}|7}}|6}}|5}}|4}}|3}}|2}}|1}}}}}">{{{bound}}}</td><td>{{{1}}}</td><td>{{{2}}}</td><td>{{{3|}}}</td></tr><!--
  
 
-->{{#if:{{{5|}}}|<tr><td>{{{4}}}</td><td>{{{5}}}</td><td>{{{6|}}}</td></tr>}}<!--
 
-->{{#if:{{{5|}}}|<tr><td>{{{4}}}</td><td>{{{5}}}</td><td>{{{6|}}}</td></tr>}}<!--

Revision as of 21:35, 21 January 2015

Creates a packet table. For use on Protocol etc. Currently supports up to 12 fields.

Example

{{Packet|id=07|state=Play|bound=Client
  |Dimension|Int|-1: The Nether, 0: The Overworld, 1: The End
  |Difficulty|Unsigned Byte|0: Peaceful, 1: Easy, 2: Normal, 3: Hard
  |Gamemode|Unsigned Byte|0: survival, 1: creative, 2: adventure. The hardcore flag is not included
  |Level Type|String|Same as [[Protocol#Join Game|Join Game]]
}}
Packet IDStateBound toField nameField typeNotes
0x07PlayClientDimensionInt-1: The Nether, 0: The Overworld, 1: The End
DifficultyUnsigned Byte0: Peaceful, 1: Easy, 2: Normal, 3: Hard
GamemodeUnsigned Byte0: survival, 1: creative, 2: adventure. The hardcore flag is not included
Level TypeStringSame as Join Game