#[non_exhaustive]pub enum GameVersion {
V1_8_9,
V1_12_2,
V1_16_5,
V26_1,
V26_2,
}Expand description
A protocol version the client supports, chosen at run time.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
V1_8_9
1.8 – 1.8.9 (protocol 47).
V1_12_2
1.12.2 (protocol 340).
V1_16_5
1.16.4 – 1.16.5 (protocol 754).
V26_1
26.1 – 26.1.2 (protocol 775).
V26_2
26.2 (protocol 776).
Implementations§
Source§impl GameVersion
impl GameVersion
Sourcepub const ALL: &'static [GameVersion]
pub const ALL: &'static [GameVersion]
Every supported version, oldest first. A slice, so that adding a version is not a breaking change.
Sourcepub const fn caps(self) -> &'static Capabilities
pub const fn caps(self) -> &'static Capabilities
What this version can do (the row the client core reads instead of comparing versions).
Sourcepub const fn enabled(self) -> bool
pub const fn enabled(self) -> bool
Whether this build of the library includes the version (its cargo feature is on).
Sourcepub fn protocol_info(self) -> &'static ProtocolVersion
pub fn protocol_info(self) -> &'static ProtocolVersion
This version’s row in the protocol table (ghast_protocol::versions): module,
feature, every game version sharing the protocol number, wire facts (the row exists
whether or not the version is compiled in; see its enabled).
Sourcepub const fn combat_1_9(self) -> bool
pub const fn combat_1_9(self) -> bool
true for 1.9 and later: the attack cooldown, the off hand, swinging after the click,
no 0.1 targeting border on entity boxes (Capabilities::combat_1_9).
Sourcepub const fn eye_height(self) -> f64
pub const fn eye_height(self) -> f64
Eye height above the feet while standing (Capabilities::eye_height).
Sourcepub const fn sneak_eye_height(self) -> f64
pub const fn sneak_eye_height(self) -> f64
Eye height while sneaking: 1.54 in 1.8 – 1.12 (getEyeHeight − 0.08), 1.27 in 1.16
(the crouching pose) (Capabilities::sneak_eye_height).
Trait Implementations§
Source§impl Clone for GameVersion
impl Clone for GameVersion
Source§fn clone(&self) -> GameVersion
fn clone(&self) -> GameVersion
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for GameVersion
Source§impl Debug for GameVersion
impl Debug for GameVersion
Source§impl Display for GameVersion
impl Display for GameVersion
impl Eq for GameVersion
Source§impl FromStr for GameVersion
impl FromStr for GameVersion
Source§fn from_str(s: &str) -> Result<GameVersion, <GameVersion as FromStr>::Err>
fn from_str(s: &str) -> Result<GameVersion, <GameVersion as FromStr>::Err>
Accepts 1.8, 1.8.x, 47, 1.12.2, 340, 1.16.4, 1.16.5, 754, 26.1,
26.1.1, 26.1.2, 775, 26.2 and 776.