From df664e4e1f4eed86629d5c2111d7f9a9d74d13fb Mon Sep 17 00:00:00 2001 From: Tnze Date: Fri, 20 May 2022 14:00:00 +0800 Subject: [PATCH] close #182 --- level/chunk.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/level/chunk.go b/level/chunk.go index 7121c50..582e392 100644 --- a/level/chunk.go +++ b/level/chunk.go @@ -390,6 +390,10 @@ type BlockEntity struct { Data nbt.RawMessage } +func (b BlockEntity) UnpackXZ() (X, Z int) { + return int((uint8(b.XZ) >> 4) & 0xF), int(uint8(b.XZ) & 0xF) +} + func (b BlockEntity) WriteTo(w io.Writer) (n int64, err error) { return pk.Tuple{ pk.Byte(b.XZ),