Skip to content

Commit 1e1ea50

Browse files
committed
Move protocol constants to API
1 parent 59d5c3a commit 1e1ea50

File tree

3 files changed

+23
-11
lines changed

3 files changed

+23
-11
lines changed

api/src/main/java/com/turikhay/mc/mapmodcompanion/PrefixedIdRequest.java

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,10 @@
1010
import static com.turikhay.mc.mapmodcompanion.Id.MAGIC_MARKER;
1111

1212
/**
13-
* Parsed description of a VoxelMap-style world id request packet.
13+
* Description of a packet sent by VoxelMap-style clients to request the
14+
* server's {@code world_id}.
1415
*
15-
* <p>Clients send such a packet to learn how the server expects the id to be
16+
* <p>Clients send this packet to learn how the server expects the id to be
1617
* encoded. Use {@link #parse(byte[], Integer)} to interpret the request and
1718
* {@link #constructId(int)} to produce a {@link PrefixedId} for the response.</p>
1819
*
@@ -74,7 +75,8 @@ public String toString() {
7475
* Parses a VoxelMap-style request packet.
7576
*
7677
* @param payload raw packet bytes
77-
* @param protocolVersion client's protocol version or {@code null} if unknown
78+
* @param protocolVersion client's protocol version or {@code null} if unknown;
79+
* see {@link ProtocolVersion} for common constants
7880
* @return parsed request descriptor
7981
* @throws MalformedPacketException if the payload cannot be parsed
8082
*/
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
package com.turikhay.mc.mapmodcompanion;
2+
3+
/**
4+
* Well-known Minecraft protocol version numbers.
5+
*
6+
* <p>These constants can be used to interpret version-specific nuances in
7+
* packet formats.</p>
8+
*/
9+
public interface ProtocolVersion {
10+
/** Protocol version number for Minecraft 1.13.2. */
11+
int MINECRAFT_1_13_2 = 404;
12+
/** Protocol version number for Minecraft 1.14.4. */
13+
int MINECRAFT_1_14_4 = 498;
14+
/** Protocol version number for Minecraft 1.15.2. */
15+
int MINECRAFT_1_15_2 = 578;
16+
/** Protocol version number for Minecraft 1.16.3. */
17+
int MINECRAFT_1_16_3 = 753;
18+
}

spigot/src/main/java/com/turikhay/mc/mapmodcompanion/spigot/ProtocolVersion.java

Lines changed: 0 additions & 8 deletions
This file was deleted.

0 commit comments

Comments
 (0)