pub enum ProtocolVersion {
V1_21,
}Expand description
Supported Minecraft protocol versions.
Each variant corresponds to a specific Minecraft release and its associated protocol version number. The protocol version is sent in the Handshake packet and determines which packet definitions and ID mappings to use.
Currently only 1.21.x is supported. Additional versions will be added as the multi-version delta/overlay model is implemented.
Variants§
V1_21
Minecraft 1.21 (protocol version 767).
Implementations§
Source§impl ProtocolVersion
impl ProtocolVersion
Sourcepub fn protocol_number(&self) -> i32
pub fn protocol_number(&self) -> i32
Returns the numeric protocol version sent in the Handshake packet.
This integer identifies the protocol version to the server and is used to select the correct packet registry. The client sends this value during the handshake; the server uses it to determine which packet definitions apply.
Sourcepub fn from_protocol_number(number: i32) -> Option<Self>
pub fn from_protocol_number(number: i32) -> Option<Self>
Attempts to resolve a protocol version from its numeric identifier.
Returns None if the protocol number doesn’t match any supported
version. This is used during handshake to determine if the server
supports the client’s protocol version.
Trait Implementations§
Source§impl Clone for ProtocolVersion
impl Clone for ProtocolVersion
Source§fn clone(&self) -> ProtocolVersion
fn clone(&self) -> ProtocolVersion
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for ProtocolVersion
impl Debug for ProtocolVersion
Source§impl Display for ProtocolVersion
impl Display for ProtocolVersion
Source§impl Hash for ProtocolVersion
impl Hash for ProtocolVersion
Source§impl PartialEq for ProtocolVersion
impl PartialEq for ProtocolVersion
impl Copy for ProtocolVersion
impl Eq for ProtocolVersion
impl StructuralPartialEq for ProtocolVersion
Auto Trait Implementations§
impl Freeze for ProtocolVersion
impl RefUnwindSafe for ProtocolVersion
impl Send for ProtocolVersion
impl Sync for ProtocolVersion
impl Unpin for ProtocolVersion
impl UnsafeUnpin for ProtocolVersion
impl UnwindSafe for ProtocolVersion
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.