From 80cc68e480d26691342fbf8096bc9cd6487dd0b8 Mon Sep 17 00:00:00 2001 From: deathcap Date: Sat, 23 Jan 2016 16:16:31 -0800 Subject: [PATCH] Add a mapper for FML|HS discrminator bytes --- examples/client_forge/client_forge.js | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/examples/client_forge/client_forge.js b/examples/client_forge/client_forge.js index a3350a7..0b3cbc6 100644 --- a/examples/client_forge/client_forge.js +++ b/examples/client_forge/client_forge.js @@ -38,8 +38,24 @@ proto.addType("string", ["pstring", { // http://wiki.vg/Minecraft_Forge_Handshake +proto.addType('fml|hsMapper', + [ + "mapper", + { + "type": "byte", + "mappings": { + "0": "ServerHello", + "1": "ClientHello", + "2": "ModList", + "3": "RegistryData", + "-1": "HandshakeAck", + "-2": "HandshakeReset" + }, + } + ] +); + // TODO: refactor to use one big switch like https://github.com/PrismarineJS/node-minecraft-protocol/blob/master/src/transforms/serializer.js#L21 -// and with a mapper for symbolic names https://github.com/PrismarineJS/prismarine-nbt/blob/master/nbt.json#L48 proto.addType('FML|HS', [ 'container',