Skip to content

Commit

Permalink
fixed packets with IDs 0
Browse files Browse the repository at this point in the history
  • Loading branch information
Pesekjak committed Jun 13, 2024
1 parent cc5196d commit cd54399
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Group and version
group = org.machinemc.paklet
version = 1.2.1
version = 1.2.2

# Dependency versions
jetbrainsAnnotations = 24.1.0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -221,8 +221,9 @@ private int computePacketID(Class<?> packetClass, String group) {
}

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

static class PacketGroup {
Expand Down

0 comments on commit cd54399

Please sign in to comment.