From 52e81deb58023eac81a95d3c8ef2445f2ef8c1e8 Mon Sep 17 00:00:00 2001 From: md_5 Date: Fri, 26 Oct 2012 17:53:07 +1100 Subject: [PATCH] Update for 1.4. Please note this is really messed and doesn't seem to work. --- pom.xml | 2 +- src/main/java/net/md_5/mendax/PacketDefinitions.java | 12 ++++++------ .../java/net/md_5/mendax/datainput/MetaData.java | 4 +++- 3 files changed, 10 insertions(+), 8 deletions(-) diff --git a/pom.xml b/pom.xml index 698d10206..1f5ea1882 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ net.md-5 mendax - 1.3.2-SNAPSHOT + 1.4.2-SNAPSHOT jar Mendax diff --git a/src/main/java/net/md_5/mendax/PacketDefinitions.java b/src/main/java/net/md_5/mendax/PacketDefinitions.java index f584b1f41..b4c42e120 100644 --- a/src/main/java/net/md_5/mendax/PacketDefinitions.java +++ b/src/main/java/net/md_5/mendax/PacketDefinitions.java @@ -16,7 +16,7 @@ public class PacketDefinitions { opCodes[0x01] = new OpCode[]{INT, STRING, BYTE, BYTE, BYTE, BYTE, BYTE}; opCodes[0x02] = new OpCode[]{BYTE, STRING, STRING, INT}; opCodes[0x03] = new OpCode[]{STRING}; - opCodes[0x04] = new OpCode[]{LONG}; + opCodes[0x04] = new OpCode[]{LONG, LONG}; opCodes[0x05] = new OpCode[]{INT, SHORT, ITEM}; opCodes[0x06] = new OpCode[]{INT, INT, INT}; opCodes[0x07] = new OpCode[]{INT, INT, BOOLEAN}; @@ -33,7 +33,7 @@ public class PacketDefinitions { opCodes[0x12] = new OpCode[]{INT, BYTE}; opCodes[0x13] = new OpCode[]{INT, BYTE}; opCodes[0x14] = new OpCode[]{INT, STRING, INT, INT, INT, BYTE, BYTE, SHORT, METADATA}; - opCodes[0x15] = new OpCode[]{INT, SHORT, BYTE, SHORT, INT, INT, INT, BYTE, BYTE, BYTE}; + opCodes[0x15] = new OpCode[]{INT, ITEM, INT, INT, INT, BYTE, BYTE, BYTE}; opCodes[0x16] = new OpCode[]{INT, INT}; opCodes[0x17] = new OpCode[]{INT, BYTE, INT, INT, INT, OPTIONAL_MOTION}; opCodes[0x18] = new OpCode[]{INT, BYTE, INT, INT, INT, BYTE, BYTE, BYTE, SHORT, SHORT, SHORT, METADATA}; @@ -71,7 +71,7 @@ public class PacketDefinitions { opCodes[0x3A] = null; // Does not exist opCodes[0x3B] = null; // Does not exist opCodes[0x3C] = new OpCode[]{DOUBLE, DOUBLE, DOUBLE, FLOAT, INT_3, FLOAT, FLOAT, FLOAT}; - opCodes[0x3D] = new OpCode[]{INT, INT, BYTE, INT, INT}; + opCodes[0x3D] = new OpCode[]{INT, INT, BYTE, INT, INT, BOOLEAN}; opCodes[0x3E] = new OpCode[]{STRING, INT, INT, INT, FLOAT, BYTE}; // // @@ -87,7 +87,7 @@ public class PacketDefinitions { // opCodes[0x64] = new OpCode[]{BYTE, BYTE, STRING, BYTE}; opCodes[0x65] = new OpCode[]{BYTE}; - opCodes[0x66] = new OpCode[]{BYTE, SHORT, BOOLEAN, SHORT, BOOLEAN, ITEM}; + opCodes[0x66] = new OpCode[]{BYTE, SHORT, BYTE, SHORT, BYTE, ITEM}; opCodes[0x67] = new OpCode[]{BYTE, SHORT, ITEM}; opCodes[0x68] = new OpCode[]{BYTE, SHORT_ITEM}; opCodes[0x69] = new OpCode[]{BYTE, SHORT, SHORT}; @@ -111,7 +111,7 @@ public class PacketDefinitions { opCodes[0xC9] = new OpCode[]{STRING, BOOLEAN, SHORT}; opCodes[0xCA] = new OpCode[]{BYTE, BYTE, BYTE}; opCodes[0xCB] = new OpCode[]{STRING}; - opCodes[0xCC] = new OpCode[]{STRING, BYTE, BYTE, BYTE}; + opCodes[0xCC] = new OpCode[]{STRING, BYTE, BYTE, BYTE, BOOLEAN}; opCodes[0xCD] = new OpCode[]{BYTE}; // // @@ -122,7 +122,7 @@ public class PacketDefinitions { opCodes[0xFB] = null; // Does not exist opCodes[0xFC] = new OpCode[]{SHORT_BYTE, SHORT_BYTE}; opCodes[0xFD] = new OpCode[]{STRING, SHORT_BYTE, SHORT_BYTE}; - opCodes[0xFE] = new OpCode[]{}; + opCodes[0xFE] = new OpCode[]{BYTE}; opCodes[0xFF] = new OpCode[]{STRING}; } } diff --git a/src/main/java/net/md_5/mendax/datainput/MetaData.java b/src/main/java/net/md_5/mendax/datainput/MetaData.java index 02985f40b..62d840103 100644 --- a/src/main/java/net/md_5/mendax/datainput/MetaData.java +++ b/src/main/java/net/md_5/mendax/datainput/MetaData.java @@ -27,7 +27,9 @@ class MetaData extends Instruction { STRING.read(in); break; case 5: - skip(in, 5); // short, byte, short + if (in.readShort() > 0) { + skip(in, 3); + } break; case 6: skip(in, 12); // int, int, int