add defaultgamemode

This commit is contained in:
Raptorox 2026-08-01 14:29:39 +02:00
parent f835beef10
commit 4f202c8ade
No known key found for this signature in database
GPG key ID: 8B3556FC3ED1F6D8
2 changed files with 40 additions and 0 deletions

View file

@ -0,0 +1,17 @@
#[derive(Default)]
pub struct DefaultGamemodeCommand {
gamemode: Option<super::Gamemode>
}
impl DefaultGamemodeCommand {
pub fn gamemode(mut self, gamemode: super::Gamemode) -> Self {
self.gamemode = Some(gamemode);
self
}
pub fn build(self) -> super::Command {
let gamemode = self.gamemode.unwrap_or(super::Gamemode::Survival);
let s = format!("defaultgamemode {gamemode}");
super::Command(s)
}
}