From 8b09f6f4eccf72e0604ef912a3f18cdf08dd2d5d Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Sun, 1 Feb 2015 14:02:04 +0100 Subject: Handle lighting and depth --- src/NBT/ByteArrayTag.hpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'src/NBT') diff --git a/src/NBT/ByteArrayTag.hpp b/src/NBT/ByteArrayTag.hpp index 2081759..4f2d331 100644 --- a/src/NBT/ByteArrayTag.hpp +++ b/src/NBT/ByteArrayTag.hpp @@ -55,9 +55,16 @@ public: return len; } - const uint8_t & operator[](size_t i) const { + const uint8_t & get(size_t i) const { return value[i]; } + + uint8_t getHalf(size_t i) const { + if (i % 2) + return (value[i/2] >> 4); + else + return (value[i/2] & 0xf); + } }; } -- cgit v1.2.3