diff --git a/mappings/net/minecraft/network/ClientConnection.mapping b/mappings/net/minecraft/network/ClientConnection.mapping
index e9310969e8..6fba28731d 100644
--- a/mappings/net/minecraft/network/ClientConnection.mapping
+++ b/mappings/net/minecraft/network/ClientConnection.mapping
@@ -25,6 +25,13 @@ CLASS net/minecraft/class_2535 net/minecraft/network/ClientConnection
FIELD field_11657 EPOLL_CLIENT_IO_GROUP Lnet/minecraft/class_3528;
FIELD field_11658 packetsReceivedCounter I
FIELD field_11660 disconnectReason Lnet/minecraft/class_2561;
+ FIELD field_33280 CURRENT_PACKET_COUNTER_WEIGHT F
+ COMMENT Represents when the average packet counter is updated, what percent of the
+ COMMENT value of the average counter is set from the current counter.
+ COMMENT
+ COMMENT
The formula is {@link #averagePacketsSent averagePacketsSent} = {@value}
+ COMMENT × {@link #packetsSentCounter packetsSentCounter} + (1 - {@value}) ×
+ COMMENT {@code averagePacketsSent}.
METHOD (Lnet/minecraft/class_2598;)V
ARG 1 side
METHOD channelActive (Lio/netty/channel/ChannelHandlerContext;)V
@@ -84,6 +91,12 @@ CLASS net/minecraft/class_2535 net/minecraft/network/ClientConnection
METHOD method_30615 updateStats ()V
METHOD method_32306 getState ()Lnet/minecraft/class_2539;
COMMENT Returns the current network state of this connection.
+ METHOD method_36121 getSide ()Lnet/minecraft/class_2598;
+ COMMENT Returns the side of this connection, or the direction of the packets received
+ COMMENT by this connection.
+ METHOD method_36122 getOppositeSide ()Lnet/minecraft/class_2598;
+ COMMENT Returns the opposite side of this connection, or the direction of the packets
+ COMMENT sent by this connection.
CLASS class_2536 QueuedPacket
FIELD field_11661 packet Lnet/minecraft/class_2596;
FIELD field_11662 callback Lio/netty/util/concurrent/GenericFutureListener;
diff --git a/mappings/net/minecraft/network/NetworkSide.mapping b/mappings/net/minecraft/network/NetworkSide.mapping
index 7133062e69..3aeab82fe5 100644
--- a/mappings/net/minecraft/network/NetworkSide.mapping
+++ b/mappings/net/minecraft/network/NetworkSide.mapping
@@ -1 +1,2 @@
CLASS net/minecraft/class_2598 net/minecraft/network/NetworkSide
+ METHOD method_36146 getOpposite ()Lnet/minecraft/class_2598;
diff --git a/mappings/net/minecraft/network/NetworkState.mapping b/mappings/net/minecraft/network/NetworkState.mapping
index 0d9dbc3335..e33c4ae288 100644
--- a/mappings/net/minecraft/network/NetworkState.mapping
+++ b/mappings/net/minecraft/network/NetworkState.mapping
@@ -3,6 +3,8 @@ CLASS net/minecraft/class_2539 net/minecraft/network/NetworkState
FIELD field_11693 STATES [Lnet/minecraft/class_2539;
FIELD field_20594 stateId I
FIELD field_20595 packetHandlers Ljava/util/Map;
+ FIELD field_33281 NULL_PACKET_ID_OR_MIN_STATE_ID I
+ FIELD field_33282 MAX_STATE_ID I
METHOD (Ljava/lang/String;IILnet/minecraft/class_2539$class_4533;)V
ARG 3 id
METHOD method_10781 getPacketId (Lnet/minecraft/class_2598;Lnet/minecraft/class_2596;)Ljava/lang/Integer;
@@ -33,3 +35,4 @@ CLASS net/minecraft/class_2539 net/minecraft/network/NetworkState
FIELD field_20598 packetHandlers Ljava/util/Map;
METHOD method_22315 setup (Lnet/minecraft/class_2598;Lnet/minecraft/class_2539$class_4532;)Lnet/minecraft/class_2539$class_4533;
ARG 1 side
+ ARG 2 handler
diff --git a/mappings/net/minecraft/network/PacketByteBuf.mapping b/mappings/net/minecraft/network/PacketByteBuf.mapping
index 20e4c896e1..ac5440461a 100644
--- a/mappings/net/minecraft/network/PacketByteBuf.mapping
+++ b/mappings/net/minecraft/network/PacketByteBuf.mapping
@@ -33,7 +33,10 @@ CLASS net/minecraft/class_2540 net/minecraft/network/PacketByteBuf
COMMENT {@link BlockPos} | {@link #readBlockPos()} | {@link #writeBlockPos(BlockPos)} |
COMMENT
COMMENT
- COMMENT {@link ChunkSectionPos} | {@link #readChunkSectionPos()} | (removed by proguard) |
+ COMMENT {@link ChunkPos} | {@link #readChunkPos()} | {@link #writeChunkPos(ChunkPos)} |
+ COMMENT
+ COMMENT
+ COMMENT {@link ChunkSectionPos} | {@link #readChunkSectionPos()} | {@link #writeChunkSectionPos(ChunkSectionPos)} |
COMMENT
COMMENT
COMMENT {@link Text} | {@link #readText()} | {@link #writeText(Text)} |
@@ -77,6 +80,29 @@ CLASS net/minecraft/class_2540 net/minecraft/network/PacketByteBuf
COMMENT IndexOutOfBoundsException} if there is not enough bytes to be read or
COMMENT not enough space to write.
FIELD field_11695 parent Lio/netty/buffer/ByteBuf;
+ FIELD field_33283 DEFAULT_MAX_STRING_LENGTH S
+ COMMENT The default max length of strings {@linkplain #readString() read} or {@linkplain
+ COMMENT #writeString(String) written}. This is also the max length of identifiers
+ COMMENT {@linkplain #readIdentifier() read} or {@linkplain #writeIdentifier(Identifier)
+ COMMENT written} in their string form.
+ FIELD field_33284 MAX_TEXT_LENGTH I
+ COMMENT The maximum size, in terms of JSON string length, allowed of the text read by
+ COMMENT {@link #readText()} or written by {@link #writeText(Text)}.
+ FIELD field_33285 MAX_VAR_INT_LENGTH I
+ COMMENT The max number of bytes an encoded var int value may use.
+ COMMENT
+ COMMENT Its value is {@value}. A regular int value always use 4 bytes in contrast.
+ COMMENT
+ COMMENT @see #getVarIntLength(int)
+ FIELD field_33286 MAX_VAR_LONG_LENGTH I
+ COMMENT The max number of bytes an encoded var long value may use.
+ COMMENT
+ COMMENT
Its value is {@value}. A regular long value always use 8 bytes in contrast.
+ COMMENT
+ COMMENT @see #getVarLongLength(long)
+ FIELD field_33287 MAX_READ_NBT_SIZE I
+ COMMENT The maximum size, in number of bytes, allowed of the NBT compound read by
+ COMMENT {@link #readNbt()}.
METHOD (Lio/netty/buffer/ByteBuf;)V
COMMENT Creates a packet byte buf that delegates its operations to the {@code
COMMENT parent} buf.
@@ -131,6 +157,7 @@ CLASS net/minecraft/class_2540 net/minecraft/network/PacketByteBuf
COMMENT
COMMENT @return this buf, for chaining
COMMENT @see #readVarLong()
+ COMMENT @see #getVarLongLength(long)
ARG 1 value
COMMENT the value to write
METHOD method_10792 readVarLong ()J
@@ -187,9 +214,9 @@ CLASS net/minecraft/class_2540 net/minecraft/network/PacketByteBuf
COMMENT the UUID to write
METHOD method_10798 readNbt ()Lnet/minecraft/class_2487;
COMMENT Reads an NBT compound from this buf. The binary representation of NBT is
- COMMENT handled by {@link net.minecraft.nbt.NbtIo}. If an Nbt null is encountered,
+ COMMENT handled by {@link net.minecraft.nbt.NbtIo}. If an NBT null is encountered,
COMMENT this method returns {@code null}. The compound can have a maximum size of
- COMMENT {@code 2097152} bytes.
+ COMMENT {@value #MAX_READ_NBT_SIZE} bytes.
COMMENT
COMMENT @return the read compound, may be {@code null}
COMMENT @throws io.netty.handler.codec.EncoderException if the NBT cannot be read
@@ -197,6 +224,7 @@ CLASS net/minecraft/class_2540 net/minecraft/network/PacketByteBuf
COMMENT @see #writeNbt(NbtCompound)
COMMENT @see #readUnlimitedNbt()
COMMENT @see #readNbt(NbtTagSizeTracker)
+ COMMENT @see #MAX_READ_NBT_SIZE
METHOD method_10799 readIntArray (I)[I
COMMENT Reads an array of primitive ints from this buf. The array first has a
COMMENT var int indicating its length, followed by the var int entries. The array
@@ -266,16 +294,18 @@ CLASS net/minecraft/class_2540 net/minecraft/network/PacketByteBuf
COMMENT
COMMENT @return this buf, for chaining
COMMENT @see #readVarInt()
+ COMMENT @see #getVarIntLength(int)
ARG 1 value
COMMENT the value to write
METHOD method_10805 writeText (Lnet/minecraft/class_2561;)Lnet/minecraft/class_2540;
COMMENT Writes a text to this buf. A text is represented by a JSON string with
- COMMENT max length {@code 262144}.
+ COMMENT max length {@value #MAX_TEXT_LENGTH}.
COMMENT
COMMENT @return this buf, for chaining
COMMENT @throws io.netty.handler.codec.EncoderException if the JSON string
- COMMENT written exceeds {@code 262144} in length
+ COMMENT written exceeds {@value #MAX_TEXT_LENGTH} in length
COMMENT @see #readText()
+ COMMENT @see #MAX_TEXT_LENGTH
ARG 1 text
COMMENT the text to write
METHOD method_10806 writeIntArray ([I)Lnet/minecraft/class_2540;
@@ -300,12 +330,13 @@ CLASS net/minecraft/class_2540 net/minecraft/network/PacketByteBuf
COMMENT the pos to write
METHOD method_10808 readText ()Lnet/minecraft/class_2561;
COMMENT Reads a text from this buf. A text is represented by a JSON string with
- COMMENT max length {@code 262144}.
+ COMMENT max length {@value #MAX_TEXT_LENGTH}.
COMMENT
COMMENT @return the read text
COMMENT @throws io.netty.handler.codec.DecoderException if the JSON string read
- COMMENT exceeds {@code 262144} in length
+ COMMENT exceeds {@value #MAX_TEXT_LENGTH} in length
COMMENT @see #writeText(Text)
+ COMMENT @see #MAX_TEXT_LENGTH
METHOD method_10809 readLongArray ([JI)[J
COMMENT Reads an array of primitive longs from this buf. The array first has a
COMMENT var int indicating its length, followed by the regular long (not var
@@ -329,11 +360,11 @@ CLASS net/minecraft/class_2540 net/minecraft/network/PacketByteBuf
METHOD method_10810 readIdentifier ()Lnet/minecraft/class_2960;
COMMENT Reads an identifier from this buf. An identifier is represented by its
COMMENT string form. The read identifier's string form can have a max length of
- COMMENT {@code 32767}.
+ COMMENT {@value #DEFAULT_MAX_STRING_LENGTH}.
COMMENT
COMMENT @return the read identifier
COMMENT @throws io.netty.handler.codec.DecoderException if the identifier's
- COMMENT string form is longer than {@code 32767}
+ COMMENT string form is longer than {@value #DEFAULT_MAX_STRING_LENGTH}
COMMENT @see #writeIdentifier(Identifier)
METHOD method_10811 readBlockPos ()Lnet/minecraft/class_2338;
COMMENT Reads a block position from this buf. A block position is represented by
@@ -344,11 +375,11 @@ CLASS net/minecraft/class_2540 net/minecraft/network/PacketByteBuf
METHOD method_10812 writeIdentifier (Lnet/minecraft/class_2960;)Lnet/minecraft/class_2540;
COMMENT Writes an identifier to this buf. An identifier is represented by its
COMMENT string form. The written identifier's byte array can have a max length of
- COMMENT {@code 32767}.
+ COMMENT {@value #DEFAULT_MAX_STRING_LENGTH}.
COMMENT
COMMENT @return the read identifier
COMMENT @throws io.netty.handler.codec.EncoderException if the {@code id}'s
- COMMENT byte array is longer than {@code 32767}
+ COMMENT byte array is longer than {@value #DEFAULT_MAX_STRING_LENGTH}
COMMENT @see #readIdentifier()
ARG 1 id
COMMENT the identifier to write
@@ -363,20 +394,20 @@ CLASS net/minecraft/class_2540 net/minecraft/network/PacketByteBuf
METHOD method_10814 writeString (Ljava/lang/String;)Lnet/minecraft/class_2540;
COMMENT Writes a string to this buf. A string is represented by a byte array of
COMMENT its UTF-8 data. That byte array can have a maximum length of
- COMMENT {@code 32767}.
+ COMMENT {@value #DEFAULT_MAX_STRING_LENGTH}.
COMMENT
COMMENT @return this buf, for chaining
COMMENT @throws io.netty.handler.codec.EncoderException if the byte array of the
- COMMENT string to write is longer than {@code 32767}
+ COMMENT string to write is longer than {@value #DEFAULT_MAX_STRING_LENGTH}
COMMENT @see #readString()
COMMENT @see #readString(int)
COMMENT @see #writeString(String, int)
ARG 1 string
COMMENT the string to write
- METHOD method_10815 getVarIntSizeBytes (I)I
+ METHOD method_10815 getVarIntLength (I)I
COMMENT Returns the number of bytes needed to encode {@code value} as a
COMMENT {@linkplain #writeVarInt(int) var int}. Guaranteed to be between {@code
- COMMENT 1} and {@code 5}.
+ COMMENT 1} and {@value #MAX_VAR_INT_LENGTH}.
COMMENT
COMMENT @return the number of bytes a var int {@code value} uses
ARG 0 value
@@ -429,14 +460,12 @@ CLASS net/minecraft/class_2540 net/minecraft/network/PacketByteBuf
COMMENT Reads a chunk section position from this buf. A chunk section position is
COMMENT represented by a regular long.
COMMENT
- COMMENT @apiNote The writing equivalent has been removed by proguard as chunk
- COMMENT section writing is only used by debug rendering. The writing equivalent
- COMMENT would be {@code buf.writeLong(chunkSectionPos.toLong())}.
- COMMENT
COMMENT @return the read chunk section pos
+ COMMENT @see #writeChunkSectionPos(ChunkSectionPos)
METHOD method_19772 readString ()Ljava/lang/String;
COMMENT Reads a string from this buf. A string is represented by a byte array of
- COMMENT its UTF-8 data. The string can have a maximum length of {@code 32767}.
+ COMMENT its UTF-8 data. The string can have a maximum length of {@value
+ COMMENT #DEFAULT_MAX_STRING_LENGTH}.
COMMENT
COMMENT @return the string read
COMMENT @throws io.netty.handler.codec.DecoderException if the string read
@@ -619,3 +648,36 @@ CLASS net/minecraft/class_2540 net/minecraft/network/PacketByteBuf
COMMENT a parser that parses each key for the map given this buf
ARG 3 valueParser
COMMENT a parser that parses each value for the map given this buf
+ METHOD method_36129 getVarLongLength (J)I
+ COMMENT Returns the number of bytes needed to encode {@code value} as a
+ COMMENT {@linkplain #writeVarLong(int) var long}. Guaranteed to be between {@code
+ COMMENT 1} and {@value #MAX_VAR_LONG_LENGTH}.
+ COMMENT
+ COMMENT @return the number of bytes a var long {@code value} uses
+ ARG 0 value
+ COMMENT the value to encode
+ METHOD method_36130 writeChunkPos (Lnet/minecraft/class_1923;)Lnet/minecraft/class_2540;
+ COMMENT Writes a chunk position to this buf. A chunk position is represented by
+ COMMENT a regular long.
+ COMMENT
+ COMMENT @return this buf, for chaining
+ COMMENT @see #readChunkPos()
+ ARG 1 pos
+ COMMENT the chunk position to write
+ METHOD method_36131 writeChunkSectionPos (Lnet/minecraft/class_4076;)Lnet/minecraft/class_2540;
+ COMMENT Reads a chunk section position from this buf. A chunk section position is
+ COMMENT represented by a regular long.
+ COMMENT
+ COMMENT @return this buf, for chaining
+ COMMENT @see #readChunkSectionPos()
+ ARG 1 pos
+ COMMENT the section position to write
+ METHOD method_36132 getWrittenBytes ()[B
+ COMMENT Returns an array of bytes of contents in this buf between index {@code 0} and
+ COMMENT the {@link #writerIndex()}.
+ METHOD method_36133 readChunkPos ()Lnet/minecraft/class_1923;
+ COMMENT Reads a chunk position from this buf. A chunk position is represented by
+ COMMENT a regular long.
+ COMMENT
+ COMMENT @return the read chunk position
+ COMMENT @see #writeChunkPos(ChunkPos)
diff --git a/mappings/net/minecraft/network/PacketDeflater.mapping b/mappings/net/minecraft/network/PacketDeflater.mapping
index 217a5bbe6e..4363d6d16c 100644
--- a/mappings/net/minecraft/network/PacketDeflater.mapping
+++ b/mappings/net/minecraft/network/PacketDeflater.mapping
@@ -2,5 +2,8 @@ CLASS net/minecraft/class_2534 net/minecraft/network/PacketDeflater
FIELD field_11636 compressionThreshold I
FIELD field_11637 deflateBuffer [B
FIELD field_11638 deflater Ljava/util/zip/Deflater;
+ METHOD (I)V
+ ARG 1 compressionThreshold
METHOD method_10742 setCompressionThreshold (I)V
ARG 1 compressionThreshold
+ METHOD method_36120 getCompressionThreshold ()I
diff --git a/mappings/net/minecraft/network/PacketInflater.mapping b/mappings/net/minecraft/network/PacketInflater.mapping
index a4f7cc5a10..47236543bd 100644
--- a/mappings/net/minecraft/network/PacketInflater.mapping
+++ b/mappings/net/minecraft/network/PacketInflater.mapping
@@ -1,7 +1,10 @@
CLASS net/minecraft/class_2532 net/minecraft/network/PacketInflater
FIELD field_11622 inflater Ljava/util/zip/Inflater;
FIELD field_11623 compressionThreshold I
+ FIELD field_33279 MAXIMUM_PACKET_SIZE I
+ COMMENT The maximum size allowed for a compressed packet. Has value {@value}.
METHOD (I)V
ARG 1 compressionThreshold
METHOD method_10739 setCompressionThreshold (I)V
ARG 1 compressionThreshold
+ METHOD method_36119 getCompressionThreshold ()I
diff --git a/mappings/net/minecraft/network/SizePrepender.mapping b/mappings/net/minecraft/network/SizePrepender.mapping
index 01224a9247..e203384be7 100644
--- a/mappings/net/minecraft/network/SizePrepender.mapping
+++ b/mappings/net/minecraft/network/SizePrepender.mapping
@@ -1 +1,4 @@
CLASS net/minecraft/class_2552 net/minecraft/network/SizePrepender
+ FIELD field_33288 MAX_PREPEND_LENGTH I
+ COMMENT The max length, in number of bytes, of the prepending size var int permitted.
+ COMMENT Has value {@value}.
diff --git a/mappings/net/minecraft/util/math/AffineTransformation.mapping b/mappings/net/minecraft/util/math/AffineTransformation.mapping
index 3bfbd95ed3..c7e685f96b 100644
--- a/mappings/net/minecraft/util/math/AffineTransformation.mapping
+++ b/mappings/net/minecraft/util/math/AffineTransformation.mapping
@@ -1,6 +1,11 @@
CLASS net/minecraft/class_4590 net/minecraft/util/math/AffineTransformation
- COMMENT @implNote Even though this is used only on the client, it accesses protected
- COMMENT fields from {@link Matrix4f}, which requires them to be in the same package.
+ COMMENT An affine transformation is a decomposition of a 4×4 real matrix into
+ COMMENT a {@linkplain #rotation1 rotation} quaternion, a {@linkplain #scale scale}
+ COMMENT 3-vector, a second {@linkplain #rotation2 rotation} quaternion, and a
+ COMMENT {@linkplain #translation translation} 3-vector. It is also known as "TRSR"
+ COMMENT transformation, meaning "translation rotation scale rotation".
+ COMMENT
+ COMMENT This class is immutable; its matrix is lazily decomposed upon demand.
FIELD field_20900 matrix Lnet/minecraft/class_1159;
FIELD field_20901 initialized Z
FIELD field_20902 translation Lnet/minecraft/class_1160;
@@ -29,3 +34,6 @@ CLASS net/minecraft/class_4590 net/minecraft/util/math/AffineTransformation
METHOD method_22936 getMatrix ()Lnet/minecraft/class_1159;
METHOD method_22937 getRotation2 ()Lnet/minecraft/class_1158;
METHOD method_22938 init ()V
+ METHOD method_35865 getTranslation ()Lnet/minecraft/class_1160;
+ METHOD method_35866 getScale ()Lnet/minecraft/class_1160;
+ METHOD method_35867 getRotation1 ()Lnet/minecraft/class_1158;
diff --git a/mappings/net/minecraft/util/thread/AtomicStack.mapping b/mappings/net/minecraft/util/thread/AtomicStack.mapping
index b5f47fef47..d4e148f028 100644
--- a/mappings/net/minecraft/util/thread/AtomicStack.mapping
+++ b/mappings/net/minecraft/util/thread/AtomicStack.mapping
@@ -3,11 +3,12 @@ CLASS net/minecraft/class_5831 net/minecraft/util/thread/AtomicStack
COMMENT an object. When the stack is full on addition, it overrides the earliest
COMMENT content in the stack.
COMMENT
- COMMENT @apiNote This class has final fields but its constructor has been removed
- COMMENT by proguard, so it's not easily usable. Vanilla uses this for debugging
- COMMENT purpose on paletted container and chunk holder's asynchronous access checks.
+ COMMENT @apiNote Vanilla uses this for debugging purpose on paletted container and
+ COMMENT chunk holder's asynchronous access checks.
FIELD field_28810 contents Ljava/util/concurrent/atomic/AtomicReferenceArray;
FIELD field_28811 size Ljava/util/concurrent/atomic/AtomicInteger;
+ METHOD (I)V
+ ARG 1 maxSize
METHOD method_33720 toList ()Ljava/util/List;
COMMENT Builds a list of the contents of the stack.
COMMENT
diff --git a/unpick-definitions/network.unpick b/unpick-definitions/network.unpick
new file mode 100644
index 0000000000..0a64f35e57
--- /dev/null
+++ b/unpick-definitions/network.unpick
@@ -0,0 +1,22 @@
+v2
+
+# value and desc specified because unpick is too dumb to handle auto conversions (short -> int, int -> long)
+constant max_string_length net/minecraft/network/PacketByteBuf DEFAULT_MAX_STRING_LENGTH 32767 I
+constant max_string_length net/minecraft/network/PacketByteBuf MAX_TEXT_LENGTH
+#constant max_nbt_size net/minecraft/network/PacketByteBuf MAX_READ_NBT_SIZE 2097152 J
+constant max_var_int_length net/minecraft/network/PacketByteBuf MAX_VAR_INT_LENGTH
+constant max_var_long_length net/minecraft/network/PacketByteBuf MAX_VAR_LONG_LENGTH
+
+target_method net/minecraft/network/PacketByteBuf readString (I)Ljava/lang/String;
+ param 0 max_string_length
+target_method net/minecraft/network/PacketByteBuf writeString (Ljava/lang/String;I)Lnet/minecraft/network/PacketByteBuf;
+ param 1 max_string_length
+# somehow does not work
+#target_method net/minecraft/nbt/NbtTagSizeTracker (J)V
+# param 0 max_nbt_size
+target_method net/minecraft/network/PacketByteBuf getVarIntLength (I)I
+ return max_var_int_length
+target_method net/minecraft/network/PacketByteBuf getVarLongLength (J)I
+ return max_var_long_length
+# var int/long length also used in readVarXx method body, but unpick cannot replace them
+