From cd06c19473b167b91c3a68884d745166bd9dd595 Mon Sep 17 00:00:00 2001 From: Nicholas Novak <34256932+NickyBoy89@users.noreply.github.com> Date: Tue, 28 Nov 2023 21:17:55 -0800 Subject: [PATCH] fix: Fixed the index lookups for non-zero chunk locations --- world/chunk_data.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/world/chunk_data.go b/world/chunk_data.go index 9c66512..fa6ca42 100644 --- a/world/chunk_data.go +++ b/world/chunk_data.go @@ -20,9 +20,9 @@ func (cd *ChunkData) IndexToBlockPos(index int) BlockPos { posZ := ((index - posX) % 256) / 16 posY := ((index - posZ) % 4096) / 256 return BlockPos{ - X: posX + cd.Pos.X, + X: posX + (cd.Pos.X * 16), Y: uint(posY), - Z: posZ + cd.Pos.Z, + Z: posZ + (cd.Pos.Z * 16), } }