testing command

This commit is contained in:
Edvin Bryntesson committed 2024-08-21 13:00:54 +02:00
1 parent 99116190d9
commit 53f7b3b573
2 files changed
+16 -1

No files matched your search

+14
View File
@@ -0,0 +1,14 @@
use pumpkin_inventory::WindowType;
use crate::commands::tree::CommandTree;
pub(crate) const NAME: &str = "chest";
const DESCRIPTION: &str = "Open a chest containing lots of diamond blocks";
pub(crate) fn init_command_tree<'a>() -> CommandTree<'a> {
CommandTree::new(DESCRIPTION).execute(&|sender, _| {
sender.as_mut_player().unwrap().open_container(WindowType::Generic3x3,"minecraft:generic_9x3",None);
Ok(())
})
}
+2 -1
View File
@@ -12,6 +12,7 @@ mod cmd_stop;
mod dispatcher; mod dispatcher;
mod tree; mod tree;
mod tree_builder; mod tree_builder;
mod cmd_chest;
pub enum CommandSender<'a> { pub enum CommandSender<'a> {
Rcon(&'a mut Vec<String>), Rcon(&'a mut Vec<String>),
@@ -77,7 +78,7 @@ fn dispatcher_init<'a>() -> CommandDispatcher<'a> {
map.insert(cmd_stop::NAME, cmd_stop::init_command_tree()); map.insert(cmd_stop::NAME, cmd_stop::init_command_tree());
map.insert(cmd_help::NAME, cmd_help::init_command_tree()); map.insert(cmd_help::NAME, cmd_help::init_command_tree());
map.insert(cmd_help::ALIAS, cmd_help::init_command_tree()); map.insert(cmd_help::ALIAS, cmd_help::init_command_tree());
map.insert(cmd_chest::NAME,cmd_chest::init_command_tree());
CommandDispatcher { commands: map } CommandDispatcher { commands: map }
} }