Skip to content

Commit cd54399

Browse files
committed
fixed packets with IDs 0
1 parent cc5196d commit cd54399

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

gradle.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Group and version
22
group = org.machinemc.paklet
3-
version = 1.2.1
3+
version = 1.2.2
44

55
# Dependency versions
66
jetbrainsAnnotations = 24.1.0

paklet-core/src/main/java/org/machinemc/paklet/PacketFactoryImpl.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -221,8 +221,9 @@ private int computePacketID(Class<?> packetClass, String group) {
221221
}
222222

223223
private int checkPacketID(int id) {
224-
if (id > 0 || id == Packet.INVALID_PACKET) return id;
225-
throw new RuntimeException("Invalid packet ID: " + id);
224+
if (id < 0 && id != Packet.INVALID_PACKET)
225+
throw new RuntimeException("Invalid packet ID: " + id);
226+
return id;
226227
}
227228

228229
static class PacketGroup {

0 commit comments

Comments
 (0)