resolve merge conflicts
This commit is contained in:
commit
3ec539d418
53 files changed
+261
-257
No files matched your search
@@ -1,6 +1,7 @@
|
||||
use std::str::FromStr;
|
||||
|
||||
use num_traits::FromPrimitive;
|
||||
use pumpkin_text::TextComponent;
|
||||
|
||||
use crate::commands::arg_player::{consume_arg_player, parse_arg_player};
|
||||
|
||||
@@ -68,7 +69,9 @@ pub(crate) fn init_command_tree<'a>() -> CommandTree<'a> {
|
||||
|
||||
return if let Player(target) = sender {
|
||||
target.set_gamemode(gamemode);
|
||||
target.send_system_message(format!("Game mode was set to {:?}", gamemode).into());
|
||||
target.send_system_message(TextComponent::text(
|
||||
&format!("Game mode was set to {:?}", gamemode)
|
||||
));
|
||||
|
||||
Ok(())
|
||||
} else {
|
||||
@@ -85,7 +88,9 @@ pub(crate) fn init_command_tree<'a>() -> CommandTree<'a> {
|
||||
let target = parse_arg_player(sender, ARG_TARGET, args)?;
|
||||
|
||||
target.set_gamemode(gamemode);
|
||||
target.send_system_message(format!("Game mode was set to {:?}", gamemode).into());
|
||||
target.send_system_message(TextComponent::text(
|
||||
&format!("Set own game mode to {:?}", gamemode)
|
||||
));
|
||||
|
||||
Ok(())
|
||||
})
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
use pumpkin_text::TextComponent;
|
||||
use crate::commands::{CommandSender, DISPATCHER, dispatcher_init};
|
||||
use crate::commands::dispatcher::{CommandDispatcher, InvalidTreeError};
|
||||
use crate::commands::dispatcher::InvalidTreeError::InvalidConsumptionError;
|
||||
@@ -41,7 +42,9 @@ pub(crate) fn init_command_tree<'a>() -> CommandTree<'a> {
|
||||
let (name, tree) = parse_arg_command(args, dispatcher)?;
|
||||
|
||||
sender.send_message(
|
||||
format!("{} - {} Usage:{}", name, tree.description, tree.paths_formatted(name)).into()
|
||||
TextComponent::text(
|
||||
&format!("{} - {} Usage:{}", name, tree.description, tree.paths_formatted(name))
|
||||
)
|
||||
);
|
||||
|
||||
Ok(())
|
||||
@@ -52,7 +55,9 @@ pub(crate) fn init_command_tree<'a>() -> CommandTree<'a> {
|
||||
|
||||
for (name, tree) in &dispatcher.commands {
|
||||
sender.send_message(
|
||||
format!("{} - {} Usage:{}", name, tree.description, tree.paths_formatted(name)).into()
|
||||
TextComponent::text(
|
||||
&format!("{} - {} Usage:{}", name, tree.description, tree.paths_formatted(name))
|
||||
)
|
||||
);
|
||||
};
|
||||
|
||||
|
||||
@@ -12,9 +12,10 @@ pub(crate) fn init_command_tree<'a>() -> CommandTree<'a> {
|
||||
CommandTree::new(DESCRIPTION).execute(&|sender, _| {
|
||||
let version = env!("CARGO_PKG_VERSION");
|
||||
let description = env!("CARGO_PKG_DESCRIPTION");
|
||||
sender.send_message(TextComponent::from(
|
||||
format!("Pumpkin {version}, {description} (Minecraft {CURRENT_MC_VERSION}, Protocol {CURRENT_MC_PROTOCOL})")).color_named(NamedColor::Green)
|
||||
);
|
||||
|
||||
sender.send_message(TextComponent::text(
|
||||
&format!("Pumpkin {version}, {description} (Minecraft {CURRENT_MC_VERSION}, Protocol {CURRENT_MC_PROTOCOL})")
|
||||
).color_named(NamedColor::Green));
|
||||
|
||||
Ok(())
|
||||
})
|
||||
|
||||
@@ -89,7 +89,7 @@ pub fn handle_command(sender: &mut CommandSender, cmd: &str) {
|
||||
|
||||
if let Err(err) = dispatcher.dispatch(sender, cmd) {
|
||||
sender.send_message(
|
||||
TextComponent::from(err)
|
||||
TextComponent::text(&err)
|
||||
.color_named(pumpkin_text::color::NamedColor::Red),
|
||||
)
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user