From 19bbf5beffd5c70af271651890e934361e499020 Mon Sep 17 00:00:00 2001 From: Nicholas Novak <34256932+NickyBoy89@users.noreply.github.com> Date: Mon, 11 Dec 2023 01:33:15 -0800 Subject: [PATCH] feat: Added support for a chunk's pos to be used as a key --- world/world_position.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/world/world_position.go b/world/world_position.go index 5be2f73..51e6af6 100644 --- a/world/world_position.go +++ b/world/world_position.go @@ -35,6 +35,10 @@ type ChunkPos struct { Z int `json:"z"` } +func (cp ChunkPos) MarshalText() ([]byte, error) { + return []byte(fmt.Sprintf("%d %d", cp.Z, cp.Z)), nil +} + func (cp ChunkPos) ToFileName() string { return fmt.Sprintf("p.%d.%d.chunk", cp.X, cp.Z) }