@@ -63,7 +63,7 @@ impl World {
63
63
self . change_senders . write ( ) . await . remove ( & uuid) ;
64
64
}
65
65
66
- pub async fn update_loaded_chunks ( & self , uuid : UUID , loaded_chunks : HashSet < ChunkColumnPosition > ) {
66
+ pub async fn ensure_loaded_chunks ( & self , uuid : UUID , loaded_chunks : HashSet < ChunkColumnPosition > ) {
67
67
let mut loading_manager = self . loading_manager . write ( ) . await ;
68
68
let loaded_chunks_before = loading_manager. get_loaded_chunks ( ) ;
69
69
loading_manager. update_loaded_chunks ( uuid, loaded_chunks) ;
@@ -160,6 +160,12 @@ impl World {
160
160
}
161
161
}
162
162
}
163
+
164
+ #[ cfg_attr( feature = "trace" , instrument( skip( self ) ) ) ]
165
+ pub async fn get_network_chunk_column_data < ' a > ( & self , position : ChunkColumnPosition ) -> Option < Vec < u8 > > {
166
+ self . map . get_network_chunk_column_data ( position) . await
167
+ }
168
+
163
169
}
164
170
165
171
#[ cfg( test) ]
@@ -173,8 +179,8 @@ mod tests {
173
179
174
180
let mut receiver1 = world. add_loader ( 1 ) . await ;
175
181
let mut receiver2 = world. add_loader ( 2 ) . await ;
176
- world. update_loaded_chunks ( 1 , vec ! [ ChunkColumnPosition { cx: 0 , cz: 0 } ] . into_iter ( ) . collect ( ) ) . await ;
177
- world. update_loaded_chunks ( 2 , vec ! [ ChunkColumnPosition { cx: 1 , cz: 1 } ] . into_iter ( ) . collect ( ) ) . await ;
182
+ world. ensure_loaded_chunks ( 1 , vec ! [ ChunkColumnPosition { cx: 0 , cz: 0 } ] . into_iter ( ) . collect ( ) ) . await ;
183
+ world. ensure_loaded_chunks ( 2 , vec ! [ ChunkColumnPosition { cx: 1 , cz: 1 } ] . into_iter ( ) . collect ( ) ) . await ;
178
184
179
185
world. set_block ( BlockPosition { x : 1 , y : 1 , z : 1 } , BlockWithState :: Air ) . await ;
180
186
assert ! ( matches!( receiver1. try_recv( ) , Ok ( WorldChange :: Block ( BlockPosition { x: 1 , y: 1 , z: 1 } , BlockWithState :: Air ) ) ) ) ;
0 commit comments