17 lines
No EOL
459 B
Rust
17 lines
No EOL
459 B
Rust
#[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)
|
|
}
|
|
} |