summaryrefslogtreecommitdiff
path: root/server/coords.go
diff options
context:
space:
mode:
Diffstat (limited to 'server/coords.go')
-rw-r--r--server/coords.go4
1 files changed, 4 insertions, 0 deletions
diff --git a/server/coords.go b/server/coords.go
index 7add606..b5334da 100644
--- a/server/coords.go
+++ b/server/coords.go
@@ -36,3 +36,7 @@ func blockToEntity(pos blockPos) entityPos {
entityCoord(pos.Z << 5),
}
}
+
+func flattenPos(pos blockPos, size blockPos) int {
+ return int(pos.X + pos.Z*size.X + pos.Y*size.X*size.Z)
+}