|
13 | 13 | * Description of a packet sent by VoxelMap-style clients to request the |
14 | 14 | * server's {@code world_id}. |
15 | 15 | * |
16 | | - * <p>Clients send this packet to learn how the server expects the id to be |
17 | | - * encoded. Use {@link #parse(byte[], Integer)} to interpret the request and |
18 | | - * {@link #constructId(int)} to produce a {@link PrefixedId} for the response.</p> |
| 16 | + * <p>The packet itself has no internal structure that influences how the |
| 17 | + * server responds. The {@link #parse(byte[], Integer)} method examines the raw |
| 18 | + * bytes and sets markers such as zero-padding length and the presence of the |
| 19 | + * magic marker {@link Id#MAGIC_MARKER}. These markers indicate which client |
| 20 | + * family and version range issued the request, allowing the server to craft a |
| 21 | + * matching {@link PrefixedId} via {@link #constructId(int)}.</p> |
19 | 22 | * |
20 | 23 | * <pre>{@code |
21 | 24 | * PrefixedIdRequest request = PrefixedIdRequest.parse(data, protocolVersion); |
@@ -72,7 +75,8 @@ public String toString() { |
72 | 75 | } |
73 | 76 |
|
74 | 77 | /** |
75 | | - * Parses a VoxelMap-style request packet. |
| 78 | + * Parses a VoxelMap-style request packet and sets markers describing the |
| 79 | + * client family and version range. |
76 | 80 | * |
77 | 81 | * @param payload raw packet bytes |
78 | 82 | * @param protocolVersion client's protocol version or {@code null} if unknown; |
@@ -105,7 +109,7 @@ public static PrefixedIdRequest parse(byte[] payload, @Nullable Integer protocol |
105 | 109 | } |
106 | 110 | switch (padding) { |
107 | 111 | case 1: |
108 | | - if (protocolVersion != null && protocolVersion <= 753) { // 1.16.3 and below |
| 112 | + if (protocolVersion != null && protocolVersion <= ProtocolVersion.MINECRAFT_1_16_3) { // 1.16.3 and below |
109 | 113 | // VoxelMap Forge 1.13.2 - 1.16.3 |
110 | 114 | return new PrefixedIdRequest(1, false); |
111 | 115 | } |
|
0 commit comments