MCPcopy Create free account
hub / github.com/boxbeam/RedLib / loadAll

Method loadAll

src/redempt/redlib/blockdata/BlockDataManager.java:352–365  ·  view source on GitHub ↗

Loads all DataBlocks stored by this BlockDataManager. Not supported for PDC. @return A CompletableFuture for the loading task.

()

Source from the content-addressed store, hash-verified

350 * @return A CompletableFuture for the loading task.
351 */
352 public CompletableFuture<Void> loadAll() {
353 save();
354 loading.values().forEach(f -> f.cancel(true));
355 loading.clear();
356 dataBlocks.clear();
357 return backend.loadAll().thenApply(chunkMap -> {
358 chunkMap.forEach((cPos, data) -> {
359 JSONMap chunkData = JSONParser.parseMap(data);
360 dataBlocks.computeIfAbsent(cPos, k -> new HashMap<>());
361 chunkData.keySet().forEach(bPos -> load(bPos, chunkData.getMap(bPos), cPos));
362 });
363 return null;
364 });
365 }
366
367 /**
368 * @return All DataBlocks currently loaded in this BlockDataManager

Callers

nothing calls this directly

Calls 8

saveMethod · 0.95
parseMapMethod · 0.95
loadMethod · 0.95
getMapMethod · 0.95
forEachMethod · 0.80
loadAllMethod · 0.65
cancelMethod · 0.45
clearMethod · 0.45

Tested by

no test coverage detected