aboutsummaryrefslogtreecommitdiff
path: root/azalea-protocol
diff options
context:
space:
mode:
authormat <github@matdoes.dev>2022-04-19 20:37:42 -0500
committermat <github@matdoes.dev>2022-04-19 20:37:42 -0500
commita45eb6deb27b8623c3d3ba9b5e21cc638272f5c8 (patch)
treed1042cd2324926dcc99d4717f2d78235902445af /azalea-protocol
parent58e58dfa8f6e2cb1a6435016be08ff3de3d8d94a (diff)
downloadazalea-drasl-a45eb6deb27b8623c3d3ba9b5e21cc638272f5c8.tar.xz
allow trailing commas in declare_state_packets
Diffstat (limited to 'azalea-protocol')
-rw-r--r--azalea-protocol/packet-macros/src/lib.rs5
1 files changed, 4 insertions, 1 deletions
diff --git a/azalea-protocol/packet-macros/src/lib.rs b/azalea-protocol/packet-macros/src/lib.rs
index 3cc3677a..d7f54d84 100644
--- a/azalea-protocol/packet-macros/src/lib.rs
+++ b/azalea-protocol/packet-macros/src/lib.rs
@@ -150,13 +150,16 @@ impl Parse for PacketIdMap {
input.parse::<Token![::]>()?;
// ClientboundChangeDifficultyPacket
let name: Ident = input.parse()?;
- input.parse::<Token![,]>()?;
packets.push(PacketIdPair {
id: packet_id,
module,
name,
});
+
+ if input.parse::<Token![,]>().is_err() {
+ break;
+ }
}
Ok(PacketIdMap { packets })