diff options
| author | mat <git@matdoes.dev> | 2023-05-26 15:18:04 -0500 |
|---|---|---|
| committer | mat <git@matdoes.dev> | 2023-05-26 15:18:04 -0500 |
| commit | 6188230009b49f96b755ade32a28b932e7810196 (patch) | |
| tree | f7b6bc8e25dfda27f3162f9e6bd53721fb3a86cc /azalea-core/src | |
| parent | 9bdace4aab064257dccb39fab4d47fde6dd9a062 (diff) | |
| download | azalea-drasl-6188230009b49f96b755ade32a28b932e7810196.tar.xz | |
add stuff related to chat signing
and also some stuff related to digging because i forgot to do a different branch lol
Diffstat (limited to 'azalea-core/src')
| -rw-r--r-- | azalea-core/src/game_type.rs | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/azalea-core/src/game_type.rs b/azalea-core/src/game_type.rs index e1a3e19b..8a17ef49 100644 --- a/azalea-core/src/game_type.rs +++ b/azalea-core/src/game_type.rs @@ -82,6 +82,15 @@ impl GameMode { } } +impl GameMode { + /// Whether the player can't interact with blocks while in this game mode. + /// + /// (Returns true if you're in adventure or spectator.) + pub fn is_block_placing_restricted(&self) -> bool { + matches!(self, GameMode::Adventure | GameMode::Spectator) + } +} + impl McBufReadable for GameMode { fn read_from(buf: &mut Cursor<&[u8]>) -> Result<Self, BufReadError> { let id = u8::read_from(buf)?; |
