aboutsummaryrefslogtreecommitdiff
path: root/azalea-brigadier/src/tree.rs
diff options
context:
space:
mode:
authormat <github@matdoes.dev>2022-04-18 15:28:25 +0000
committermat <github@matdoes.dev>2022-04-18 15:28:30 +0000
commit3f87fc506861cc813675d30081d94b025bada97d (patch)
tree977d13b7991af90fd96136182455a82b00696ae5 /azalea-brigadier/src/tree.rs
parentd25c9926d714e1920a8656452f20cab60565443f (diff)
downloadazalea-drasl-3f87fc506861cc813675d30081d94b025bada97d.tar.xz
add find_node
Diffstat (limited to 'azalea-brigadier/src/tree.rs')
-rw-r--r--azalea-brigadier/src/tree.rs4
1 files changed, 4 insertions, 0 deletions
diff --git a/azalea-brigadier/src/tree.rs b/azalea-brigadier/src/tree.rs
index ee279542..3dc75de0 100644
--- a/azalea-brigadier/src/tree.rs
+++ b/azalea-brigadier/src/tree.rs
@@ -138,6 +138,10 @@ impl<S> CommandNode<S> {
}
}
+ pub fn child(&self, name: &str) -> Option<Rc<RefCell<CommandNode<S>>>> {
+ self.children.get(name).cloned()
+ }
+
pub fn parse_with_context(
&self,
reader: &mut StringReader,