add player name selector

This commit is contained in:
Raptorox 2026-08-01 12:48:38 +02:00
parent 2ddd24fc82
commit 72a0cf8c69
No known key found for this signature in database
GPG key ID: 8B3556FC3ED1F6D8

View file

@ -8,7 +8,8 @@ pub enum Selector {
AllPlayers, // @a AllPlayers, // @a
AllEntities, // @e AllEntities, // @e
Executor, // @s Executor, // @s
NearestEntity // @n NearestEntity, // @n,
Player(String)
} }
impl Display for Selector { impl Display for Selector {
@ -19,7 +20,8 @@ impl Display for Selector {
Self::AllPlayers => write!(f, "@a"), Self::AllPlayers => write!(f, "@a"),
Self::AllEntities => write!(f, "@e"), Self::AllEntities => write!(f, "@e"),
Self::Executor => write!(f, "@s"), 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 say;
mod list; mod list;
mod kill; mod kill;
mod ban;
impl Command { impl Command {
pub fn raw(cmd: &str) -> Self { pub fn raw(cmd: &str) -> Self {
@ -48,4 +51,8 @@ impl Command {
pub fn kill() -> kill::KillCommand { pub fn kill() -> kill::KillCommand {
kill::KillCommand::default() kill::KillCommand::default()
} }
pub fn ban() -> ban::BanCommand {
ban::BanCommand::default()
}
} }