Advertisement
NickG

Untitled

Nov 1st, 2013
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 15.92 KB | None | 0 0
  1. #Most of the data formats, structures, and magic values
  2.  
  3. MC_PROTOCOL_VERSION = 4
  4.  
  5. SERVER_TO_CLIENT    = 0x01
  6. CLIENT_TO_SERVER    = 0x02
  7.  
  8. HANDSHAKE_STATE     = 0x00
  9. STATUS_STATE        = 0x01
  10. LOGIN_STATE         = 0x02
  11. PLAY_STATE          = 0x03
  12.  
  13. data_types = {
  14.     'bool'  : ('?', 1),
  15.     'ubyte' : ('B', 1),
  16.     'byte'  : ('b', 1),
  17.     'ushort': ('H', 2),
  18.     'short' : ('h', 2),
  19.     'uint'  : ('I', 4),
  20.     'int'   : ('i', 4),
  21.     'long'  : ('q', 8),
  22.     'float' : ('f', 4),
  23.     'double': ('d', 8),
  24. }
  25.  
  26.  
  27. names = {
  28.     HANDSHAKE_STATE: {
  29.         CLIENT_TO_SERVER: {
  30.             0x00: 'Handshake',
  31.         }
  32.  
  33.     STATUS_STATE: {
  34.         SERVER_TO_CLIENT: {
  35.             0x00: 'Status Response',
  36.             0x01: 'Status Ping',
  37.         },
  38.         CLIENT_TO_SERVER: {
  39.             0x00: 'Status Request',
  40.             0x01: 'Status Ping',
  41.         },
  42.     },
  43.  
  44.     LOGIN_STATE: {
  45.         SERVER_TO_CLIENT: {
  46.             0x00: 'Disconnect',
  47.             0x01: 'Encryption Request',
  48.             0x02: 'Login Request',
  49.         },
  50.         CLIENT_TO_SERVER: {
  51.             0x00: 'Login Start',
  52.             0x01: 'Encryption Response',
  53.         },
  54.     },
  55.  
  56.     PLAY_STATE: {
  57.         SERVER_TO_CLIENT: {
  58.             0x00: 'Keep Alive',
  59.             0x01: 'Join Game',
  60.             0x02: 'Chat Message',
  61.             0x03: 'Time Update',
  62.             0x04: 'Entity Equipment',
  63.             0x05: 'Spawn Position',
  64.             0x06: 'Update Health',
  65.             0x07: 'Respawn',
  66.             0x08: 'Player Position and Look',
  67.             0x09: 'Held Item Change',
  68.             0x0A: 'Use Bed',
  69.             0x0B: 'Animation',
  70.             0x0C: 'Spawn Player',
  71.             0x0D: 'Collect Item',
  72.             0x0E: 'Spawn Object',
  73.             0x0F: 'Spawn Mob',
  74.             0x10: 'Spawn Painting',
  75.             0x11: 'Spawn Experience Orb',
  76.             0x12: 'Entity Velocity',
  77.             0x13: 'Destroy Entities',
  78.             0x14: 'Entity',
  79.             0x15: 'Entity Relative Move',
  80.             0x16: 'Entity Look',
  81.             0x17: 'Entity Look and Relative Move',
  82.             0x18: 'Entity Teleport',
  83.             0x19: 'Entity Head Look',
  84.             0x1A: 'Entity Status',
  85.             0x1B: 'Attach Entity',
  86.             0x1D: 'Entity Metadata',
  87.             0x1E: 'Remove Entity Effect',
  88.             0x1F: 'Set Experience',
  89.             0x20: 'Entity Properties',
  90.             0x21: 'Chunk Data',
  91.             0x22: 'Multi Block Change',
  92.             0x23: 'Block Change',
  93.             0x24: 'Block Action',
  94.             0x25: 'Block Break Animation',
  95.             0x26: 'Map Chunk Bulk',
  96.             0x27: 'Explosion',
  97.             0x28: 'Effect',
  98.             0x29: 'Sound Effect',
  99.             0x2A: 'Particle',
  100.             0x2B: 'Change Game State',
  101.             0x2C: 'Spawn Global Entity',
  102.             0x2D: 'Open Window',
  103.             0x2E: 'Close Window',
  104.             0x2F: 'Set Slot',
  105.             0x30: 'Window Items',
  106.             0x31: 'Window Property',
  107.             0x32: 'Confirm Transaction',
  108.             0x33: 'Update Sign',
  109.             0x34: 'Maps',
  110.             0x35: 'Update Block Entity',
  111.             0x36: 'Sign Editor Open',
  112.             0x37: 'Statistics',
  113.             0x38: 'Player List Item',
  114.             0x39: 'Player Abilities',
  115.             0x3A: 'Tab-Complete',
  116.             0x3B: 'Scoreboard Objective',
  117.             0x3C: 'Update Score',
  118.             0x3D: 'Display Scoreboard',
  119.             0x3E: 'Teams',
  120.             0x3F: 'Plugin Message',
  121.             0x40: 'Disconnect',
  122.         },
  123.  
  124.         CLIENT_TO_SERVER: {
  125.             0x00: 'Keep Alive',
  126.             0x01: 'Chat Message',
  127.             0x02: 'Use Entity',
  128.             0x03: 'Player',
  129.             0x04: 'Player Position',
  130.             0x05: 'Player Look',
  131.             0x06: 'Player Position and Look',
  132.             0x07: 'Player Digging',
  133.             0x08: 'Player Block Placement',
  134.             0x09: 'Held Item Change',
  135.             0x0A: 'Animation',
  136.             0x0B: 'Entity Action',
  137.             0x0C: 'Steer Vehicle',
  138.             0x0D: 'Close Window',
  139.             0x0E: 'Click Window',
  140.             0x0F: 'Confirm Transaction',
  141.             0x10: 'Creative Inventory Action',
  142.             0x11: 'Enchant Item',
  143.             0x12: 'Update Sign',
  144.             0x13: 'Player Abilities',
  145.             0x14: 'Tab-Complete',
  146.             0x15: 'Client Settings',
  147.             0x16: 'Client Status',
  148.             0x17: 'Plugin Message',
  149.         },
  150.     },
  151. }
  152.  
  153. packet_structs = {
  154.     HANDSHAKE_STATE: {
  155.         CLIENT_TO_SERVER: {
  156.             #Handshake
  157.             0x00: (
  158.                 ('varint', 'protocol_version'),
  159.                 ('string', 'host'),
  160.                 ('ushort', 'port'),
  161.                 ('varint', 'next_state'),
  162.             ),
  163.         },
  164.     },
  165.  
  166.     STATUS_STATE: {
  167.         SERVER_TO_CLIENT: {
  168.             #Status Response
  169.             0x00: (
  170.                 ('string', 'json_response'),
  171.             ),
  172.             #Status Ping
  173.             0x01: (
  174.                 ('long', 'time'),
  175.             ),
  176.         },
  177.         CLIENT_TO_SERVER: {
  178.             #Status Request
  179.             #Empty Packet
  180.             0x00: (),
  181.             #Status Ping
  182.             0x01: (
  183.                 ('long', 'time'),
  184.             ),
  185.         },
  186.     },
  187.  
  188.     LOGIN_STATE: {
  189.         SERVER_TO_CLIENT: {
  190.             #Disconnect
  191.             0x00: (
  192.                 ('string', 'json_data'),
  193.             ),
  194.             #Encryption Request
  195.             0x01: (
  196.                 ('string', 'server_id'),
  197.             ),
  198.             #Login Success
  199.             0x02: (
  200.                 ('string', 'uuid'),
  201.                 ('string', 'username'),
  202.             ),
  203.         },
  204.         CLIENT_TO_SERVER: {
  205.             #Login Start
  206.             0x00: (
  207.                 ('string', 'name'),
  208.             ),
  209.             #Encryption Response
  210.             #Covered entirely in extensions
  211.             0x01: (),
  212.         },
  213.     },
  214.  
  215.     PLAY_STATE: {
  216.         SERVER_TO_CLIENT: {
  217.             #Keep Alive
  218.             0x00: (
  219.                 ('int', 'keep_alive'),
  220.             ),
  221.             #Join Game
  222.             0x01: (
  223.                 ('int'   , 'eid'),
  224.                 ('ubyte' , 'gamemode'),
  225.                 ('byte'  , 'dimension'),
  226.                 ('ubyte' , 'difficulty'),
  227.                 ('ubyte' , 'max_players'),
  228.                 ('string', 'level_type'),
  229.             ),
  230.             #Chat Message
  231.             0x02: (
  232.                 ('string', 'json_data'),
  233.             ),
  234.             #Time Update
  235.             0x03: (
  236.                 ('long', 'world_age'),
  237.                 ('long', 'time_of_day'),
  238.             ),
  239.             #Entity Equipment
  240.             0x04: (
  241.                 ('int'  , 'eid'),
  242.                 ('short', 'slot'),
  243.                 ('slot' , 'item'),
  244.             ),
  245.             #Spawn Position
  246.             0x05: (
  247.                 ('int', 'x'),
  248.                 ('int', 'y'),
  249.                 ('int', 'z'),
  250.             ),
  251.             #Update Health
  252.             0x06: (
  253.                 ('float', 'health'),
  254.                 ('short', 'food'),
  255.                 ('float', 'saturation'),
  256.             ),
  257.             #Respawn
  258.             0x07: (
  259.                 ('int'   , 'dimension'),
  260.                 ('ubyte' , 'difficulty'),
  261.                 ('ubyte' , 'gamemode'),
  262.                 ('string', 'level_type'),
  263.             ),
  264.             #Player Position and Look
  265.             0x08: (
  266.                 ('double', 'x'),
  267.                 ('double', 'y'),
  268.                 ('double', 'z'),
  269.                 ('float' , 'yaw'),
  270.                 ('pitch' , 'float'),
  271.                 ('bool'  , 'on_ground'),
  272.             ),
  273.             #Held Item Change
  274.             0x09: (
  275.                 ('byte', 'slot'),
  276.             ),
  277.             #Use Bed
  278.             0x0A: (
  279.                 ('int'  , 'eid'),
  280.                 ('int'  , 'x'),
  281.                 ('ubyte', 'y'),
  282.                 ('int'  , 'z')
  283.             ),
  284.             #Animation
  285.             0x0B: (
  286.                 ('varint', 'eid'),
  287.                 ('ubyte' , 'animation'),
  288.             ),
  289.             #Spawn Player
  290.             0x0C: (
  291.                 ('varint', 'eid'),
  292.                 ('string', 'player_uuid'),
  293.                 ('string', 'player_name'),
  294.                 ('int'   , 'x'),
  295.                 ('int'   , 'y'),
  296.                 ('int'   , 'z'),
  297.                 ('byte'  , 'yaw'),
  298.                 ('byte'  , 'pitch'),
  299.                 ('short' , 'current_item'),
  300.                 ('metadata', 'metadata'),
  301.             ),
  302.             #Collect Item
  303.             0x0D: (
  304.                 ('int', 'collected_eid'),
  305.                 ('int', 'collector_eid'),
  306.             ),
  307.             #Spawn Object
  308.             0x0E: (
  309.                 ('varint', 'eid'),
  310.                 ('ubyte' , 'type'),
  311.                 ('int'   , 'x'),
  312.                 ('int'   , 'y'),
  313.                 ('int'   , 'z'),
  314.                 ('byte'  , 'pitch'),
  315.                 ('byte'  , 'yaw'), 
  316.                 ('object_data', 'data'),   
  317.             ),
  318.             #Spawn Mob
  319.             0x0F: (
  320.                 ('varint', 'eid'),
  321.                 ('ubyte' , 'type'),
  322.                 ('int'   , 'x'),
  323.                 ('int'   , 'y'),
  324.                 ('int'   , 'z'),
  325.                 ('byte'  , 'pitch'),
  326.                 ('byte'  , 'head_pitch'),
  327.                 ('byte'  , 'yaw'),
  328.                 ('short' , 'velocity_x'),
  329.                 ('short' , 'velocity_y'),
  330.                 ('short' , 'velocity_z'),
  331.                 ('metadata', 'metadata'),
  332.             ),
  333.             #Spawn Painting
  334.             0x10: (
  335.                 ('varint', 'eid'),
  336.                 ('string', 'title'),
  337.                 ('int'   , 'x'),
  338.                 ('int'   , 'y'),
  339.                 ('int'   , 'z'),
  340.                 ('int'   , 'direction'),
  341.             ),
  342.             #Spawn Experience Orb
  343.             0x11: (
  344.                 ('varint', 'eid'),
  345.                 ('ubyte' , 'type'),
  346.                 ('int'   , 'x'),
  347.                 ('int'   , 'y'),
  348.                 ('int'   , 'z'),
  349.                 ('short' , 'count'),
  350.             ),
  351.             #Entity Velocity
  352.             0x12: (
  353.                 ('int'  , 'eid'),
  354.                 ('short', 'velocity_x'),
  355.                 ('short', 'velocity_y'),
  356.                 ('short', 'velocity_z'),
  357.             ),
  358.             #Destroy Entities
  359.             0x13: (
  360.                 ('byte', 'count'),
  361.             ),
  362.             #Entity
  363.             0x14: (
  364.                 ('int', 'eid'),
  365.             ),
  366.             #Entity Relative Move
  367.             0x15: (
  368.                 ('int' , 'eid'),
  369.                 ('byte', 'dx'),
  370.                 ('byte', 'dy'),
  371.                 ('byte', 'dz'),
  372.             ),
  373.             #Entity Look
  374.             0x16: (
  375.                 ('int' , 'eid'),
  376.                 ('byte', 'yaw'),
  377.                 ('byte', 'pitch'),
  378.             ),
  379.             #Entity Look and Relative Move
  380.             0x17: (
  381.                 ('int' , 'eid'),
  382.                 ('byte', 'dx'),
  383.                 ('byte', 'dy'),
  384.                 ('byte', 'dz'),
  385.                 ('byte', 'yaw'),
  386.                 ('byte', 'pitch'),
  387.             ),
  388.             #Entity Teleport
  389.             0x18: (
  390.                 ('int' , 'eid'),
  391.                 ('int' , 'x'),
  392.                 ('int' , 'y'),
  393.                 ('int' , 'z'),
  394.                 ('byte', 'yaw'),
  395.                 ('byte', 'pitch'),
  396.             ),
  397.             #Entity Head Look
  398.             0x19: (
  399.                 ('int' , 'eid'),
  400.                 ('byte', 'head_yaw'),
  401.             ),
  402.             #Entity Status
  403.             0x1A: (
  404.                 ('int' , 'eid'),
  405.                 ('byte', 'status')
  406.             ),
  407.             #Attach Entity
  408.             0x1B: (
  409.                 ('int' , 'eid'),
  410.                 ('int' , 'v_eid'),
  411.                 ('bool', 'leash'),
  412.             ),
  413.             #Entity Metadata
  414.             0x1D: (
  415.                 ('int'  , 'eid'),
  416.                 ('byte' , 'effect'),
  417.                 ('byte' , 'amplifier'),
  418.                 ('short', 'duration'),
  419.             ),
  420.             #Remove Entity Effect
  421.             0x1E: (
  422.                 ('int' , 'eid'),
  423.                 ('byte', 'effect'),
  424.             ),
  425.             #Set Experience
  426.             0x1F: (
  427.                 ('float', 'exp_bar'),
  428.                 ('short', 'level'),
  429.                 ('short', 'total_exp'),
  430.             ),
  431.             #Entity Properties
  432.             0x20: (
  433.                 ('int', 'eid'),
  434.                 ('int', 'count'),
  435.             ),
  436.             #Chunk Data
  437.             0x21: (
  438.                 ('int'   , 'chunk_x'),
  439.                 ('int'   , 'chunk_z'),
  440.                 ('bool'  , 'continuous'),
  441.                 ('ushort', 'primary_bitmap'),
  442.                 ('ushort', 'add_bitmap'),
  443.                 ('int'   , 'size'),
  444.             ),
  445.             #Multi Block Change
  446.             0x22: (
  447.                 ('int'  , 'chunk_x'),
  448.                 ('int'  , 'chunk_z'),
  449.                 ('short', 'count'),
  450.                 ('int'  , 'size'),
  451.             ),
  452.             #Block Change
  453.             0x23: (
  454.                 ('int'   , 'x'),
  455.                 ('ubyte' , 'y'),
  456.                 ('int'   , 'z'),
  457.                 ('varint', 'block_type'),
  458.                 ('ubyte' , 'data'),
  459.             ),
  460.             #Block Action
  461.             0x24: (
  462.                 ('int'   , 'x'),
  463.                 ('short' , 'y'),
  464.                 ('int'   , 'z'),
  465.                 ('ubyte' , 'byte_1'),
  466.                 ('ubyte' , 'byte_2'),
  467.                 ('varint', 'block_type'),
  468.             ),
  469.             #Block Break Animation
  470.             0x25: (
  471.                 ('varint', 'eid'),
  472.                 ('int'   , 'x'),
  473.                 ('int'   , 'y'),
  474.                 ('int'   , 'z'),
  475.                 ('byte'  , 'stage'),
  476.             ),
  477.             #Map Chunk Bulk
  478.             0x26: (
  479.                 ('short', 'count'),
  480.                 ('int'  , 'size'),
  481.                 ('bool' , 'sky_light'),
  482.             ),
  483.             #Explosion
  484.             0x27: (
  485.                 ('float', 'x'),
  486.                 ('float', 'y'),
  487.                 ('float', 'z'),
  488.                 ('float', 'radius'),
  489.                 ('int'  , 'count'),
  490.             ),
  491.             #Effect
  492.             0x28: (
  493.                 ('int' , 'effect'),
  494.                 ('int' , 'x'),
  495.                 ('byte', 'y'),
  496.                 ('int' , 'z'),
  497.                 ('int' , 'data'),
  498.                 ('bool', 'no_rel_vol'),
  499.             ),
  500.             #Sound Effect
  501.             0x29: (
  502.                 ('string', 'name'),
  503.                 ('int'   , 'ef_x'),
  504.                 ('int'   , 'ef_y'),
  505.                 ('int'   , 'ef_z'),
  506.                 ('float' , 'vol'),
  507.                 ('ubyte' , 'pitch'),
  508.             ),
  509.             #Particle
  510.             0x2A: (
  511.                 ('string', 'name'),
  512.                 ('float' , 'x'),
  513.                 ('float' , 'y'),
  514.                 ('float' , 'z'),
  515.                 ('float' , 'off_x'),
  516.                 ('float' , 'off_y'),
  517.                 ('float' , 'off_z'),
  518.                 ('float' , 'speed'),
  519.                 ('float' , 'num'),
  520.             ),
  521.             #Change Game State
  522.             0x2B: (
  523.                 ('ubyte', 'reason'),
  524.                 ('float', 'value'),
  525.             ),
  526.             #Spawn Global Entity
  527.             0x2C: (
  528.                 ('varint', 'eid'),
  529.                 ('byte', 'type'),
  530.                 ('int' , 'x'),
  531.                 ('int' , 'y'),
  532.                 ('int' , 'z'),
  533.             ),
  534.             #Open Window
  535.             0x2D: (
  536.                 ('ubyte' , 'window_id'),
  537.                 ('ubyte' , 'inv_type'),
  538.                 ('string', 'title'),
  539.                 ('ubyte' , 'slot_count'),
  540.                 ('bool'  , 'use_title'),
  541.                 ('int'   , 'eid'),
  542.             ),
  543.             #Close Window
  544.             0x2E: (
  545.                 ('ubyte', 'window_id'),
  546.             ),
  547.             #Set Slot
  548.             0x2F: (
  549.                 ('ubyte', 'window_id'),
  550.                 ('short', 'slot'),
  551.                 ('slot' , 'slot_data'),
  552.             ),
  553.             #Window Items
  554.             0x30: (
  555.                 ('ubyte', 'window_id'),
  556.                 ('short', 'count'),
  557.             ),
  558.             #Window Property
  559.             0x31: (
  560.                 ('ubyte', 'window_id'),
  561.                 ('short', 'property'),
  562.                 ('short', 'value'),
  563.             ),
  564.             #Confirm Transaction
  565.             0x32: (
  566.                 ('ubyte', 'window_id'),
  567.                 ('short', 'action'),
  568.                 ('bool' , 'accepted'),
  569.             ),
  570.             #Update Sign
  571.             0x33: (
  572.                 ('int'   , 'x'),
  573.                 ('short' , 'y'),
  574.                 ('int'   , 'z'),
  575.                 ('string', 'line_1'),
  576.                 ('string', 'line_2'),
  577.                 ('string', 'line_3'),
  578.                 ('string', 'line_4'),
  579.             ),
  580.             #Maps
  581.             0x34: (
  582.                 ('varint', 'item_damage'),
  583.                 ('short' , 'size'),
  584.             ),
  585.             #Update Block Entity
  586.             0x35: (
  587.                 ('int'   , 'x'),
  588.                 ('short' , 'y'),
  589.                 ('int'   , 'z'),
  590.                 ('ubyte' , 'action'),
  591.                 ('short' , 'size'),
  592.             ),
  593.             #Sign Editor Open
  594.             0x36: (
  595.                 ('int'   , 'x'),
  596.                 ('int'   , 'y'),
  597.                 ('int'   , 'z'),
  598.             ),
  599.             #Statistics
  600.             0x37: (
  601.                 ('varint', 'count'),
  602.             ),
  603.             #Player List Item
  604.             0x38: (
  605.                 ('string', 'player_name'),
  606.                 ('bool'  , 'online'),
  607.                 ('short' , 'ping'),
  608.  
  609.             ),
  610.             #Player Abilities
  611.             0x39: (
  612.                 ('byte', 'flags'),
  613.                 ('float', 'flying_speed'),
  614.                 ('float', 'walking_speed'),
  615.             ),
  616.             #Tab-Complete
  617.             0x3A: (
  618.                 ('varint', 'count')
  619.             ),
  620.             #Scoreboard Objective
  621.             0x3B: (
  622.                 ('string', 'obj_name'),
  623.                 ('string', 'obj_val'),
  624.                 ('byte'  , 'action'),
  625.             ),
  626.             #Update Score
  627.             0x3C: (
  628.                 ('string', 'item_name'),
  629.                 ('byte'  , 'action'),
  630.                 ('string', 'score_name'),
  631.                 ('int'   , 'value'),
  632.             ),
  633.             #Display Scoreboard
  634.             0x3D: (
  635.                 ('byte'  , 'position'),
  636.                 ('string', 'score_name'),
  637.             ),
  638.             #Teams
  639.             0x3E: (
  640.                 ('string', 'team_name'),
  641.                 ('byte'  , 'mode'),
  642.                 ('string', 'display_name'),
  643.                 ('string', 'prefix'),
  644.                 ('string', 'suffix'),
  645.                 ('byte'  , 'friendly_fire'),
  646.                 ('short' , 'count'),
  647.             ),
  648.             #Plugin Message
  649.             0x3F: (
  650.                 ('string', 'channel'),
  651.                 ('short' , 'size'),
  652.             ),
  653.             #Disconnect
  654.             0x40: (
  655.                 ('string', 'reason'),
  656.             ),
  657.         },
  658.  
  659.         CLIENT_TO_SERVER: {
  660.             #Keep Alive
  661.             0x00: (
  662.                 ('int', 'keep_alive'),
  663.             ),
  664.             #Chat Message
  665.             0x01: (
  666.                 ('string', 'message'),
  667.             ),
  668.             #Use Entity
  669.             0x02: (
  670.                 ('int' , 'target'),
  671.                 ('byte', 'mouse'),
  672.             ),
  673.             #Player
  674.             0x03: (
  675.                 ('bool', 'on_ground'),
  676.             ),
  677.             #Player Position
  678.             0x04: (
  679.                 ('double', 'x'),
  680.                 ('double', 'y'),
  681.                 ('double', 'stance'),
  682.                 ('double', 'z'),
  683.                 ('bool'  , 'on_ground'),
  684.             ),
  685.             #Player Look
  686.             0x05: (
  687.                 ('float', 'yaw'),
  688.                 ('float', 'pitch'),
  689.                 ('bool' , 'on_ground'),
  690.             ),
  691.             #Player Position and Look
  692.             0x06: (
  693.                 ('double', 'x'),
  694.                 ('double', 'y'),
  695.                 ('double', 'stance'),
  696.                 ('double', 'z'),
  697.                 ('float', 'yaw'),
  698.                 ('float', 'pitch'),
  699.                 ('bool' , 'on_ground'),
  700.             ),
  701.             #Player Digging
  702.             0x07: (
  703.                 ('byte' , 'status'),
  704.                 ('int'  , 'x'),
  705.                 ('ubyte', 'y'),
  706.                 ('int'  , 'z'),
  707.                 ('byte' , 'face'),
  708.             ),
  709.             #Player Block Placement
  710.             0x08: (
  711.                 ('int'  , 'x'),
  712.                 ('ubyte', 'y'),
  713.                 ('int'  , 'z'),
  714.                 ('byte' , 'direction'),
  715.                 ('slot' , 'held_item'),
  716.                 ('byte' , 'cur_pos_x'),
  717.                 ('byte' , 'cur_pos_y'),
  718.                 ('byte' , 'cur_pos_z'),
  719.             ),
  720.             #Held Item Change
  721.             0x09: (
  722.                 ('short', 'slot'),
  723.             ),
  724.             #Animation
  725.             0x0A: (
  726.                 ('int', 'eid'),
  727.                 ('byte', 'animation'),
  728.             ),
  729.             #Entity Action
  730.             0x0B: (
  731.                 ('int' , 'eid'),
  732.                 ('byte', 'action'),
  733.                 ('int' , 'jump_boost'),
  734.             ),
  735.             #Steer Vehicle
  736.             0x0C: (
  737.                 ('float', 'sideways'),
  738.                 ('float', 'forward'),
  739.                 ('bool' , 'jump'),
  740.                 ('bool' , 'unmount'),
  741.             ),
  742.             #Close Window
  743.             0x0D: (
  744.                 ('byte', 'window_id'),
  745.             ),
  746.             #Click Window
  747.             0x0E: (
  748.                 ('byte' , 'window_id'),
  749.                 ('short', 'slot'),
  750.                 ('byte' , 'button'),
  751.                 ('short', 'action'),
  752.                 ('byte' , 'mode'),
  753.                 ('slot' , 'clicked_item'),
  754.             ),
  755.             #Confirm Transaction
  756.             0x0F: (
  757.                 ('byte' , 'window_id'),
  758.                 ('short', 'action'),
  759.                 ('bool' , 'accepted'),
  760.             ),
  761.             #Creative Inventory Action
  762.             0x10: (
  763.                 ('short', 'slot'),
  764.                 ('slot' , 'clicked_item'),
  765.             ),
  766.             #Enchant Item
  767.             0x11: (
  768.                 ('byte', 'window_id'),
  769.                 ('byte', 'enchantment'),
  770.             ),
  771.             #Update Sign
  772.             0x12: (
  773.                 ('int'   , 'x'),
  774.                 ('short' , 'y'),
  775.                 ('int'   , 'z'),
  776.                 ('string', 'line_1'),
  777.                 ('string', 'line_2'),
  778.                 ('string', 'line_3'),
  779.                 ('string', 'line_4'),
  780.             ),
  781.             #Player Abilities
  782.             0x13: (
  783.                 ('byte', 'flags'),
  784.                 ('float', 'flying_speed'),
  785.                 ('float', 'walking_speed'),
  786.             ),
  787.             #Tab-Complete
  788.             0x14: (
  789.                 ('string', 'text'),
  790.             ),
  791.             #Client Settings
  792.             0x15: (
  793.                 ('string', 'locale'),
  794.                 ('byte'  , 'view_distance'),
  795.                 ('byte'  , 'chat_flags'),
  796.                 ('bool'  , 'unused'),
  797.                 ('byte'  , 'difficulty'),
  798.                 ('bool'  , 'show_cape'),
  799.             ),
  800.             #Client Status
  801.             0x16: (
  802.                 ('byte', 'action'),
  803.             ),
  804.             #Plugin Message
  805.             0x17: (
  806.                 ('string', 'channel'),
  807.                 ('short' , 'size'),
  808.             )
  809.         },
  810.     },
  811. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement