From ea5584f28cef2bceb3a93dc39312d69f0cac6afe Mon Sep 17 00:00:00 2001 From: md_5 Date: Thu, 18 Oct 2012 13:50:06 +1100 Subject: [PATCH] Strings can be treated as short_short --- .../net/md_5/mc/protocol/PacketDefinitions.java | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-) diff --git a/src/main/java/net/md_5/mc/protocol/PacketDefinitions.java b/src/main/java/net/md_5/mc/protocol/PacketDefinitions.java index f34b11c1..205fafe0 100644 --- a/src/main/java/net/md_5/mc/protocol/PacketDefinitions.java +++ b/src/main/java/net/md_5/mc/protocol/PacketDefinitions.java @@ -3,7 +3,6 @@ package net.md_5.mc.protocol; import java.io.DataInput; import java.io.IOException; import java.util.ArrayList; -import java.util.Arrays; import java.util.List; public class PacketDefinitions { @@ -20,18 +19,7 @@ public class PacketDefinitions { private static final Instruction BYTE_INT = new ByteHeader(INT); private static final Instruction INT_BYTE = new IntHeader(BYTE); private static final Instruction INT_3 = new IntHeader(new JumpOpCode(3)); - private static final Instruction STRING = new Instruction() { - @Override - void read(DataInput in) throws IOException { - short len = in.readShort(); - skip(in, len * 2); - } - - @Override - public String toString() { - return "String"; - } - }; + private static final Instruction STRING = new ShortHeader(SHORT); private static final Instruction ITEM = new Instruction() { @Override void read(DataInput in) throws IOException {