mirror of
https://gitlab.com/veloren/veloren.git
synced 2024-08-30 18:12:32 +00:00
Add MakeNPC admin command
This commit is contained in:
@ -1,6 +1,6 @@
|
||||
//! # Implementing new commands.
|
||||
//! To implement a new command, add an instance of `ChatCommand` to
|
||||
//! `CHAT_COMMANDS` and provide a handler function.
|
||||
//! To implement a new command provide a handler function
|
||||
//! in [do_command].
|
||||
|
||||
use crate::{
|
||||
settings::{
|
||||
@ -68,6 +68,7 @@ impl ChatCommandExt for ChatCommand {
|
||||
}
|
||||
|
||||
type CmdResult<T> = Result<T, String>;
|
||||
|
||||
/// Handler function called when the command is executed.
|
||||
/// # Arguments
|
||||
/// * `&mut Server` - the `Server` instance executing the command.
|
||||
@ -140,6 +141,7 @@ fn do_command(
|
||||
ChatCommand::Lantern => handle_lantern,
|
||||
ChatCommand::Light => handle_light,
|
||||
ChatCommand::MakeBlock => handle_make_block,
|
||||
ChatCommand::MakeNpc => handle_make_npc,
|
||||
ChatCommand::MakeSprite => handle_make_sprite,
|
||||
ChatCommand::Motd => handle_motd,
|
||||
ChatCommand::Object => handle_object,
|
||||
@ -547,6 +549,16 @@ fn handle_make_block(
|
||||
}
|
||||
}
|
||||
|
||||
fn handle_make_npc(
|
||||
_server: &mut Server,
|
||||
_client: EcsEntity,
|
||||
_target: EcsEntity,
|
||||
_args: Vec<String>,
|
||||
_action: &ChatCommand,
|
||||
) -> CmdResult<()> {
|
||||
Err("Not implemented".to_owned())
|
||||
}
|
||||
|
||||
fn handle_make_sprite(
|
||||
server: &mut Server,
|
||||
_client: EcsEntity,
|
||||
|
Reference in New Issue
Block a user