summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKevin Chabowski <kevin@kch42.de>2013-08-15 22:02:49 +0200
committerKevin Chabowski <kevin@kch42.de>2013-08-15 22:02:49 +0200
commit49d1214ca12d9463102fa48d74e0b9bd3853dc5e (patch)
treeda92e161e9ec749a4b9f0379c639f234dfee48f9
parentbc5f8dc9e4406d41a4b4cf8b8039888cb2c60e71 (diff)
downloadgomcmap-49d1214ca12d9463102fa48d74e0b9bd3853dc5e.tar.gz
gomcmap-49d1214ca12d9463102fa48d74e0b9bd3853dc5e.tar.bz2
gomcmap-49d1214ca12d9463102fa48d74e0b9bd3853dc5e.zip
Fixed BlockToChunk
-rw-r--r--mcmap/chunk.go4
1 files 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