diff --git a/lib/protocol.js b/lib/protocol.js index 52072c8..e3e4d00 100644 --- a/lib/protocol.js +++ b/lib/protocol.js @@ -538,7 +538,34 @@ var packets = { { name: "cameraId", type: "varint" } ]}, world_border: { id: 0x44, fields: [ - /* TODO: Going to be a pain... */ + { name: "action", type: "varint"}, + { name: "radius", type: "double", condition: function(field_values) { + return field_values['action'] == 0; + } }, + { name: "x", type: "double", condition: function(field_values) { + return field_values['action'] == 2 || field_values['action'] == 3; + } }, + { name: "z", type: "double", condition: function(field_values) { + return field_values['action'] == 2 || field_values['action'] == 3; + } }, + { name: "old_radius", type: "double", condition: function(field_values) { + return field_values['action'] == 1 || field_values['action'] == 3; + } }, + { name: "new_radius", type: "double", condition: function(field_values) { + return field_values['action'] == 1 || field_values['action'] == 3; + } }, + { name: "speed", type: "varlong", condition: function(field_values) { + return field_values['action'] == 1 || field_values['action'] == 3; + } }, + { name: "portalBoundary", type: "varint", condition: function(field_values) { + return field_values['action'] == 3; + } }, + { name: "warning_time", type: "varint", condition: function(field_values) { + return field_values['action'] == 4 || field_values['action'] == 3; + } }, + { name: "warning_blocks", type: "varint", condition: function(field_values) { + return field_values['action'] == 5 || field_values['action'] == 3; + } } ]}, title: { id: 0x45, fields: [ /* TODO: Going to be a pain too */