add player name selector
This commit is contained in:
parent
2ddd24fc82
commit
72a0cf8c69
1 changed files with 9 additions and 2 deletions
|
|
@ -8,7 +8,8 @@ pub enum Selector {
|
|||
AllPlayers, // @a
|
||||
AllEntities, // @e
|
||||
Executor, // @s
|
||||
NearestEntity // @n
|
||||
NearestEntity, // @n,
|
||||
Player(String)
|
||||
}
|
||||
|
||||
impl Display for Selector {
|
||||
|
|
@ -19,7 +20,8 @@ impl Display for Selector {
|
|||
Self::AllPlayers => write!(f, "@a"),
|
||||
Self::AllEntities => write!(f, "@e"),
|
||||
Self::Executor => write!(f, "@s"),
|
||||
Self::NearestEntity => write!(f, "@n")
|
||||
Self::NearestEntity => write!(f, "@n"),
|
||||
Self::Player(name) => write!(f, "{name}")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -27,6 +29,7 @@ impl Display for Selector {
|
|||
mod say;
|
||||
mod list;
|
||||
mod kill;
|
||||
mod ban;
|
||||
|
||||
impl Command {
|
||||
pub fn raw(cmd: &str) -> Self {
|
||||
|
|
@ -48,4 +51,8 @@ impl Command {
|
|||
pub fn kill() -> kill::KillCommand {
|
||||
kill::KillCommand::default()
|
||||
}
|
||||
|
||||
pub fn ban() -> ban::BanCommand {
|
||||
ban::BanCommand::default()
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue