Skip to content

Commit

Permalink
Export NBT packet field type
Browse files Browse the repository at this point in the history
  • Loading branch information
ya7on committed Nov 30, 2023
1 parent c42c3b7 commit 9637d25
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
1 change: 1 addition & 0 deletions mclib/main/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ pub mod types {
pub use mclib_protocol::types::boolean::MCBoolean;
pub use mclib_protocol::types::byte::MCByte;
pub use mclib_protocol::types::long::MCLong;
pub use mclib_protocol::types::nbt::MCNBT;
pub use mclib_protocol::types::ubyte::MCUByte;
pub use mclib_protocol::types::ushort::MCUShort;
pub use mclib_protocol::types::uuid::MCUuid;
Expand Down
12 changes: 12 additions & 0 deletions mclib/protocol/src/types/nbt.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,18 @@ use std::io::Read;
#[derive(Debug, Clone)]
pub struct MCNBT(NBT);

impl From<NBT> for MCNBT {
fn from(value: NBT) -> Self {
Self(value)
}
}

impl From<MCNBT> for NBT {
fn from(value: MCNBT) -> Self {
value.0
}
}

impl MCType for MCNBT {
fn pack(&self) -> Vec<u8> {
self.0.pack()
Expand Down

0 comments on commit 9637d25

Please sign in to comment.