diff options
| -rw-r--r-- | azalea-protocol/src/packets/game/clientbound_commands_packet.rs | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/azalea-protocol/src/packets/game/clientbound_commands_packet.rs b/azalea-protocol/src/packets/game/clientbound_commands_packet.rs index 732ceaa9..c05f710a 100644 --- a/azalea-protocol/src/packets/game/clientbound_commands_packet.rs +++ b/azalea-protocol/src/packets/game/clientbound_commands_packet.rs @@ -10,7 +10,7 @@ use std::io::{Read, Write}; pub struct ClientboundCommandsPacket { pub entries: Vec<BrigadierNodeStub>, #[var] - pub root_index: i32, + pub root_index: u32, } #[derive(Debug, Clone)] @@ -279,3 +279,13 @@ pub enum NodeType { suggestions_type: Option<ResourceLocation>, }, } + +impl BrigadierNodeStub { + pub fn name(&self) -> Option<&str> { + match &self.node_type { + NodeType::Root => None, + NodeType::Literal { name } => Some(name), + NodeType::Argument { name, .. } => Some(name), + } + } +} |
