summary refs log tree commit diff
path: root/src/World/ChunkRegistry.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/World/ChunkRegistry.cpp')
-rw-r--r--src/World/ChunkRegistry.cpp9
1 files changed, 3 insertions, 6 deletions
diff --git a/src/World/ChunkRegistry.cpp b/src/World/ChunkRegistry.cpp
index 41fd1b0..97896fe 100644
--- a/src/World/ChunkRegistry.cpp
+++ b/src/World/ChunkRegistry.cpp
@@ -15,14 +15,11 @@ ChunkRegistry::Data& ChunkRegistry::get(ChunkIndex index) {
 }
 
 ChunkRegistry::Data& ChunkRegistry::find(Position::BlockWorld pos) {
-    return get({
-        static_cast<I32>(pos.x() / Chunk::Width),
-        static_cast<I32>(pos.z() / Chunk::Width)
-    });
+    return get(ChunkIndex::from_position(pos));
 }
 
-ChunkRegistry::Data& ChunkRegistry::find(ChunkIndex chunk, Position::BlockLocal pos) {
-    return find(chunk.world(pos));
+ChunkRegistry::Data& ChunkRegistry::find(Position::World pos) {
+    return find(pos.round_to_block());
 }
 
 }
\ No newline at end of file