This commit is contained in:
shenjack-mac 2023-08-02 20:01:53 +08:00
parent ba6050801f
commit 469321657c

View File

@ -141,6 +141,13 @@ macro_rules! read_data {
#[allow(unused)] #[allow(unused)]
impl NbtValue { impl NbtValue {
pub fn as_end(&self) -> Option<()> {
match self {
Self::NbtEnd => Some(()),
_ => None,
}
}
export_data!(as_bool, NbtByte, bool); export_data!(as_bool, NbtByte, bool);
export_data!(as_i16, NbtShort, i16); export_data!(as_i16, NbtShort, i16);
export_data!(as_i32, NbtInt, i32); export_data!(as_i32, NbtInt, i32);