mirror of
https://github.com/PaperMC/Paper.git
synced 2025-08-07 07:32:03 -07:00
Update to Minecraft 1.9.2
This commit is contained in:
@@ -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());
|
||||
|
Reference in New Issue
Block a user