1
2
Fork 0
mirror of https://github.com/mat-1/azalea.git synced 2025-08-02 06:16:04 +00:00

BrigadierNodeStub::name()

This commit is contained in:
mat 2022-09-06 22:24:21 -05:00
parent 403ae0d72b
commit 8fe02ed115

View file

@ -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),
}
}
}