31 lines
No EOL
521 B
Rust
31 lines
No EOL
521 B
Rust
pub struct Command(String);
|
|
|
|
pub enum Selector {
|
|
NearestPlayer, // @p
|
|
RandomPlayer, // @r
|
|
AllPlayers, // @a
|
|
AllEntities, // @e
|
|
Executor, // @s
|
|
NearestEntity // @n
|
|
}
|
|
|
|
mod say;
|
|
mod list;
|
|
|
|
impl Command {
|
|
pub fn raw(cmd: &str) -> Self {
|
|
Self(cmd.to_string())
|
|
}
|
|
|
|
pub fn as_str(&self) -> &str {
|
|
&self.0
|
|
}
|
|
|
|
pub fn say() -> say::SayCommand {
|
|
say::SayCommand::default()
|
|
}
|
|
|
|
pub fn list() -> list::ListCommand {
|
|
list::ListCommand::default()
|
|
}
|
|
} |