From 469321657cfa532f46cae6d4037fcf0450865a27 Mon Sep 17 00:00:00 2001 From: shenjack-mac <3695888@qq.com> Date: Wed, 2 Aug 2023 20:01:53 +0800 Subject: [PATCH] add end --- src/data.rs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/data.rs b/src/data.rs index b59f5e0..06467b2 100644 --- a/src/data.rs +++ b/src/data.rs @@ -141,6 +141,13 @@ macro_rules! read_data { #[allow(unused)] impl NbtValue { + pub fn as_end(&self) -> Option<()> { + match self { + Self::NbtEnd => Some(()), + _ => None, + } + } + export_data!(as_bool, NbtByte, bool); export_data!(as_i16, NbtShort, i16); export_data!(as_i32, NbtInt, i32);