summaryrefslogtreecommitdiffstats
path: root/nms-patches/PacketDataSerializer.patch
diff options
context:
space:
mode:
authorThinkofname <thinkofdeath@spigotmc.org>2016-03-30 20:50:59 +0100
committerThinkofname <thinkofdeath@spigotmc.org>2016-03-30 21:06:51 +0100
commit6e527e5b884902df883eb1a3d594ba4dc5147962 (patch)
treec066763146d5c5bb50bdf6c6896f8490c884b3df /nms-patches/PacketDataSerializer.patch
parent7fc5cd856e46182e727f383a911ffa46326611f1 (diff)
downloadcraftbukkit-6e527e5b884902df883eb1a3d594ba4dc5147962.tar
craftbukkit-6e527e5b884902df883eb1a3d594ba4dc5147962.tar.gz
craftbukkit-6e527e5b884902df883eb1a3d594ba4dc5147962.tar.lz
craftbukkit-6e527e5b884902df883eb1a3d594ba4dc5147962.tar.xz
craftbukkit-6e527e5b884902df883eb1a3d594ba4dc5147962.zip
Update to Minecraft 1.9.2
Diffstat (limited to 'nms-patches/PacketDataSerializer.patch')
-rw-r--r--nms-patches/PacketDataSerializer.patch26
1 files changed, 4 insertions, 22 deletions
diff --git a/nms-patches/PacketDataSerializer.patch b/nms-patches/PacketDataSerializer.patch
index d15d36df..e77b2e14 100644
--- a/nms-patches/PacketDataSerializer.patch
+++ b/nms-patches/PacketDataSerializer.patch
@@ -13,25 +13,7 @@
public PacketDataSerializer(ByteBuf bytebuf) {
this.a = bytebuf;
-@@ -44,8 +47,16 @@
- return this;
- }
-
-+ // CraftBukkit start - limit length
- public byte[] a() {
-- byte[] abyte = new byte[this.g()];
-+ return readByteArray(Short.MAX_VALUE);
-+ }
-+
-+ public byte[] readByteArray(int limit) {
-+ int len = this.g();
-+ if (len > limit) throw new DecoderException("The received a byte array longer than allowed " + len + " > " + limit);
-+ byte[] abyte = new byte[len];
-+ // CraftBukkit end
-
- this.readBytes(abyte);
- return abyte;
-@@ -99,7 +110,7 @@
+@@ -119,7 +122,7 @@
}
public <T extends Enum<T>> T a(Class<T> oclass) {
@@ -40,7 +22,7 @@
}
public PacketDataSerializer a(Enum<?> oenum) {
-@@ -176,7 +187,7 @@
+@@ -196,7 +199,7 @@
} else {
try {
NBTCompressedStreamTools.a(nbttagcompound, (DataOutput) (new ByteBufOutputStream(this)));
@@ -49,7 +31,7 @@
throw new EncoderException(ioexception);
}
}
-@@ -202,7 +213,7 @@
+@@ -222,7 +225,7 @@
}
public PacketDataSerializer a(ItemStack itemstack) {
@@ -58,7 +40,7 @@
this.writeShort(-1);
} else {
this.writeShort(Item.getId(itemstack.getItem()));
-@@ -230,6 +241,11 @@
+@@ -250,6 +253,11 @@
itemstack = new ItemStack(Item.getById(short0), b0, short1);
itemstack.setTag(this.j());