From b12beb32654d5e2acf927e34ea3acb1765e058a6 Mon Sep 17 00:00:00 2001 From: Will Franzen Date: Tue, 30 Dec 2014 12:55:38 -0600 Subject: [PATCH] Implement title packet --- lib/protocol.js | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/lib/protocol.js b/lib/protocol.js index e3e4d00..58e0ce8 100644 --- a/lib/protocol.js +++ b/lib/protocol.js @@ -568,7 +568,19 @@ var packets = { } } ]}, title: { id: 0x45, fields: [ - /* TODO: Going to be a pain too */ + { name: "action", type: "varint"}, + { name: "text", type: "string", condition: function(field_values) { + return field_values['action'] == 0 || field_values['action'] == 1; + } }, + { name: "fadeIn", type: "int", condition: function(field_values) { + return field_values['action'] == 0 || field_values['action'] == 1; + } }, + { name: "stay", type: "int", condition: function(field_values) { + return field_values['action'] == 2; + } }, + { name: "fadeOut", type: "int", condition: function(field_values) { + return field_values['action'] == 2; + } } ]}, set_compression: { id: 0x46, fields: [ { name: "threshold", type: "varint"}