From 49d1214ca12d9463102fa48d74e0b9bd3853dc5e Mon Sep 17 00:00:00 2001 From: Kevin Chabowski Date: Thu, 15 Aug 2013 22:02:49 +0200 Subject: Fixed BlockToChunk --- mcmap/chunk.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mcmap/chunk.go b/mcmap/chunk.go index 7214831..45ab75c 100644 --- a/mcmap/chunk.go +++ b/mcmap/chunk.go @@ -23,8 +23,8 @@ func offsetToPos(off int) (x, y, z int) { // BlockToChunk calculates the chunk (cx, cz) and the block position in this chunk(rbx, rbz) of a block position given global coordinates. func BlockToChunk(bx, bz int) (cx, cz, rbx, rbz int) { - cx = bx << 4 - cz = bz << 4 + cx = bx >> 4 + cz = bz >> 4 rbx = ((cx % ChunkSizeXZ) + ChunkSizeXZ) % ChunkSizeXZ rbz = ((cz % ChunkSizeXZ) + ChunkSizeXZ) % ChunkSizeXZ return -- cgit v1.2.3-54-g00ecf