From 10cd1733cbba5c637fa0130a0cd7a7ab6e618226 Mon Sep 17 00:00:00 2001 From: mat Date: Sun, 17 Apr 2022 14:40:26 -0500 Subject: add execute & get_integer --- azalea-brigadier/src/builder/argument_builder.rs | 1 - azalea-brigadier/src/builder/required_argument_builder.rs | 7 +++++-- 2 files changed, 5 insertions(+), 3 deletions(-) (limited to 'azalea-brigadier/src/builder') diff --git a/azalea-brigadier/src/builder/argument_builder.rs b/azalea-brigadier/src/builder/argument_builder.rs index 1fb775c2..17e9d625 100644 --- a/azalea-brigadier/src/builder/argument_builder.rs +++ b/azalea-brigadier/src/builder/argument_builder.rs @@ -67,7 +67,6 @@ impl ArgumentBuilder { } pub fn build(self) -> CommandNode { - println!("building {:?}", self); CommandNode { value: self.value, diff --git a/azalea-brigadier/src/builder/required_argument_builder.rs b/azalea-brigadier/src/builder/required_argument_builder.rs index 95f4da01..9cd089de 100644 --- a/azalea-brigadier/src/builder/required_argument_builder.rs +++ b/azalea-brigadier/src/builder/required_argument_builder.rs @@ -1,5 +1,8 @@ use super::argument_builder::{ArgumentBuilder, ArgumentBuilderType}; -use crate::{parsers::Parser, string_reader::StringReader}; +use crate::{ + exceptions::command_syntax_exception::CommandSyntaxException, parsers::Parser, + string_reader::StringReader, +}; use std::{any::Any, fmt::Debug, rc::Rc}; /// An argument node type. The `T` type parameter is the type of the argument, @@ -17,7 +20,7 @@ impl Argument { } } - pub fn parse(&self, reader: &mut StringReader) -> Option> { + pub fn parse(&self, reader: &mut StringReader) -> Result, CommandSyntaxException> { self.parser.parse(reader) } } -- cgit v1.2.3