#[non_exhaustive]pub struct ClientSettings {
pub locale: String,
pub view_distance: i8,
pub chat_mode: i8,
pub chat_colors: bool,
pub skin_parts: u8,
pub main_hand: i32,
}Expand description
Client settings (settings packet), sent right after join game like vanilla.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.locale: StringLocale, e.g. en_US (1.8) / en_us (1.16).
view_distance: i8View distance in chunks.
chat_mode: i8Chat visibility: 0 full, 1 commands only, 2 hidden.
chat_colors: boolChat colours.
skin_parts: u8Displayed skin parts (bit mask; 0x7f = all).
main_hand: i32Main hand (1.9+): 0 left, 1 right.
Implementations§
Source§impl ClientSettings
impl ClientSettings
Sourcepub fn with_locale(self, locale: impl Into<String>) -> Self
pub fn with_locale(self, locale: impl Into<String>) -> Self
The locale, e.g. en_US (1.8) / en_us (1.16).
Sourcepub const fn with_view_distance(self, chunks: i8) -> Self
pub const fn with_view_distance(self, chunks: i8) -> Self
The view distance in chunks.
Sourcepub const fn with_chat_mode(self, mode: i8) -> Self
pub const fn with_chat_mode(self, mode: i8) -> Self
Chat visibility: 0 full, 1 commands only, 2 hidden.
Sourcepub const fn with_chat_colors(self, on: bool) -> Self
pub const fn with_chat_colors(self, on: bool) -> Self
Chat colours.
Sourcepub const fn with_skin_parts(self, mask: u8) -> Self
pub const fn with_skin_parts(self, mask: u8) -> Self
Displayed skin parts (bit mask; 0x7f = all).
Sourcepub const fn with_main_hand(self, hand: i32) -> Self
pub const fn with_main_hand(self, hand: i32) -> Self
Main hand (1.9+): 0 left, 1 right.
Trait Implementations§
Source§impl Clone for ClientSettings
impl Clone for ClientSettings
Source§impl Debug for ClientSettings
impl Debug for ClientSettings
Source§impl Default for ClientSettings
impl Default for ClientSettings
Source§impl PartialEq for ClientSettings
impl PartialEq for ClientSettings
impl StructuralPartialEq for ClientSettings
Auto Trait Implementations§
impl Freeze for ClientSettings
impl RefUnwindSafe for ClientSettings
impl Send for ClientSettings
impl Sync for ClientSettings
impl Unpin for ClientSettings
impl UnsafeUnpin for ClientSettings
impl UnwindSafe for ClientSettings
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more