summaryrefslogtreecommitdiff
path: root/server/coords.go
diff options
context:
space:
mode:
authorraven <citrons@mondecitronne.com>2026-03-23 18:53:14 -0500
committerraven <citrons@mondecitronne.com>2026-03-24 12:45:51 -0500
commit31fa67112ccd9eeabf31ca20e10e5956c1f6ff38 (patch)
tree465629ca70ff1faca524f46591346a05a10eb0b4 /server/coords.go
parentb8d39a6ac1c7a85bb2f48f594d9b0a8f9d8dce42 (diff)
optimized level data structure
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)
+}