From 6ae94b96e6d51e3bf251d4a01f17fa7d41c9500f Mon Sep 17 00:00:00 2001 From: mat Date: Mon, 20 Dec 2021 15:22:02 -0600 Subject: start adding nbt to the protocol --- azalea-nbt/src/error.rs | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'azalea-nbt/src/error.rs') diff --git a/azalea-nbt/src/error.rs b/azalea-nbt/src/error.rs index 3ada7cf7..05ff15e0 100644 --- a/azalea-nbt/src/error.rs +++ b/azalea-nbt/src/error.rs @@ -4,3 +4,13 @@ pub enum Error { InvalidTag, WriteError, } + +impl std::fmt::Display for Error { + fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { + match self { + Error::InvalidTagType(id) => write!(f, "Invalid tag type: {}", id), + Error::InvalidTag => write!(f, "Invalid tag"), + Error::WriteError => write!(f, "Write error"), + } + } +} -- cgit v1.2.3