diff --git a/plugins/hello-plugin-source/src/lib.rs b/plugins/hello-plugin-source/src/lib.rs index acd83b6d..99c30aae 100644 --- a/plugins/hello-plugin-source/src/lib.rs +++ b/plugins/hello-plugin-source/src/lib.rs @@ -102,18 +102,16 @@ impl CommandExecutor for SetblockExecutor { pub fn init_command_tree() -> CommandTree { CommandTree::new(NAMES, DESCRIPTION).with_child( - require(|sender| { - sender.has_permission_lvl(PermissionLvl::Two) && sender.world().is_some() - }) - .with_child( - argument(ARG_BLOCK_POS, BlockPosArgumentConsumer).with_child( - argument(ARG_BLOCK, BlockArgumentConsumer) - .with_child(literal("replace").execute(SetblockExecutor(Mode::Replace))) - .with_child(literal("destroy").execute(SetblockExecutor(Mode::Destroy))) - .with_child(literal("keep").execute(SetblockExecutor(Mode::Keep))) - .execute(SetblockExecutor(Mode::Replace)), + require(|sender| sender.has_permission_lvl(PermissionLvl::Two) && sender.world().is_some()) + .with_child( + argument(ARG_BLOCK_POS, BlockPosArgumentConsumer).with_child( + argument(ARG_BLOCK, BlockArgumentConsumer) + .with_child(literal("replace").execute(SetblockExecutor(Mode::Replace))) + .with_child(literal("destroy").execute(SetblockExecutor(Mode::Destroy))) + .with_child(literal("keep").execute(SetblockExecutor(Mode::Keep))) + .execute(SetblockExecutor(Mode::Replace)), + ), ), - ), ) } diff --git a/pumpkin-api-macros/src/lib.rs b/pumpkin-api-macros/src/lib.rs index 5b86168d..17f83dc9 100644 --- a/pumpkin-api-macros/src/lib.rs +++ b/pumpkin-api-macros/src/lib.rs @@ -222,14 +222,14 @@ pub fn plugin_impl(attr: TokenStream, item: TokenStream) -> TokenStream { #[proc_macro_attribute] pub fn with_runtime(attr: TokenStream, item: TokenStream) -> TokenStream { let mut input = parse_macro_input!(item as ItemImpl); - + let use_global = attr.to_string() == "global"; - + for item in &mut input.items { if let ImplItem::Fn(method) = item { if method.sig.asyncness.is_some() { let original_body = &method.block; - + method.block = if use_global { parse_quote!({ crate::GLOBAL_RUNTIME.block_on(async move { @@ -245,11 +245,11 @@ pub fn with_runtime(attr: TokenStream, item: TokenStream) -> TokenStream { }) }) }; - + method.sig.asyncness = None; } } } - + TokenStream::from(quote!(#input)) -} \ No newline at end of file +} diff --git a/pumpkin-nbt/src/lib.rs b/pumpkin-nbt/src/lib.rs index acee723f..5ed48da9 100644 --- a/pumpkin-nbt/src/lib.rs +++ b/pumpkin-nbt/src/lib.rs @@ -208,10 +208,7 @@ mod test { use crate::BytesArray; use crate::IntArray; use crate::LongArray; - use crate::{ - deserializer::from_bytes_unnamed, - serializer::to_bytes_unnamed, - }; + use crate::{deserializer::from_bytes_unnamed, serializer::to_bytes_unnamed}; #[derive(Serialize, Deserialize, PartialEq, Debug)] struct Test { diff --git a/pumpkin/src/command/args/mod.rs b/pumpkin/src/command/args/mod.rs index 7a63af8f..16a1dd80 100644 --- a/pumpkin/src/command/args/mod.rs +++ b/pumpkin/src/command/args/mod.rs @@ -66,7 +66,6 @@ pub trait GetClientSideArgParser { fn get_client_side_suggestion_type_override(&self) -> Option; } - pub trait DefaultNameArgConsumer: ArgumentConsumer { fn default_name(&self) -> String; }