Update to Minecraft 1.9.2

This commit is contained in:
Thinkofname
2016-03-30 20:50:59 +01:00
parent 7fc5cd856e
commit 6e527e5b88
30 changed files with 126 additions and 182 deletions

View File

@@ -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());