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:
parent
403ae0d72b
commit
8fe02ed115
1 changed files with 11 additions and 1 deletions
|
@ -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),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue