Difference between revisions of "Template:Packet"

From wiki.vg
Jump to navigation Jump to search
(updated for current packet tables)
Line 1: Line 1:
<noinclude>
+
<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><!--
= Usage Example =
+
 
{{Packet|Keep Alive|0x00}}
+
--><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><!--
</noinclude>
+
 
<h3><span id="{{{2}}}" class="mw-headline">{{{1}}} ({{{2}}})</span></h3>
+
-->{{#if:{{{5|}}}|<tr><td>{{{4}}}</td><td>{{{5}}}</td><td>{{{6|}}}</td></tr>}}<!--
 +
-->{{#if:{{{8|}}}|<tr><td>{{{7}}}</td><td>{{{8}}}</td><td>{{{9|}}}</td></tr>}}<!--
 +
-->{{#if:{{{11|}}}|<tr><td>{{{10}}}</td><td>{{{11}}}</td><td>{{{12|}}}</td></tr>}}<!--
 +
-->{{#if:{{{14|}}}|<tr><td>{{{13}}}</td><td>{{{14}}}</td><td>{{{15|}}}</td></tr>}}<!--
 +
-->{{#if:{{{17|}}}|<tr><td>{{{16}}}</td><td>{{{17}}}</td><td>{{{18|}}}</td></tr>}}<!--
 +
-->{{#if:{{{20|}}}|<tr><td>{{{19}}}</td><td>{{{20}}}</td><td>{{{21|}}}</td></tr>}}<!--
 +
-->{{#if:{{{23|}}}|<tr><td>{{{22}}}</td><td>{{{23}}}</td><td>{{{24|}}}</td></tr>}}<!--
 +
-->{{#if:{{{26|}}}|<tr><td>{{{25}}}</td><td>{{{26}}}</td><td>{{{27|}}}</td></tr>}}<!--
 +
-->{{#if:{{{29|}}}|<tr><td>{{{28}}}</td><td>{{{29}}}</td><td>{{{30|}}}</td></tr>}}<!--
 +
-->{{#if:{{{32|}}}|<tr><td>{{{31}}}</td><td>{{{32}}}</td><td>{{{33|}}}</td></tr>}}<!--
 +
-->{{#if:{{{35|}}}|<tr><td>{{{34}}}</td><td>{{{35}}}</td><td>{{{36|}}}</td></tr>}}<!--
 +
 
 +
--></table></includeonly><noinclude>Creates a packet table. For use on [[Protocol]] etc. Currently supports up to 12 fields.
 +
 
 +
== Example ==
 +
 
 +
<pre>{{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]]
 +
}}</pre>
 +
 
 +
{{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]]
 +
}}
 +
 
 +
[[Category:Templates]]

Revision as of 21:34, 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]]
}}
<thead></thead><tbody>
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