diff --git a/src/data/CacheContainer.ts b/src/data/CacheContainer.ts index f737276..6af61e9 100644 --- a/src/data/CacheContainer.ts +++ b/src/data/CacheContainer.ts @@ -12,6 +12,7 @@ export class CacheContainer extends PatchContainer { // eslint-disable-next-line no-use-before-define static singleton: CacheContainer pendingRefresh = false + builtInCache = false // specify whether cache is managed internally or separately static cachePowRadius = 2 static cacheSize = BlocksPatch.patchSize * 5 // static worldApi = new WorldApi() @@ -45,7 +46,7 @@ export class CacheContainer extends PatchContainer { * @param dryRun * @returns true if cache was update, false otherwise */ - async refresh(bbox: Box3, dryRun = false) { + async refresh(bbox: Box3) { let changesDiff if (!this.pendingRefresh) { const emptyContainer = new PatchContainer() @@ -61,7 +62,7 @@ export class CacheContainer extends PatchContainer { super.init(bbox) // restore remaining patches backup this.populateFromExisting(backup) - !dryRun && (await this.populate(this.missingPatchKeys)) + this.builtInCache && (await this.populate(this.missingPatchKeys)) } } // return patch keys changes diff --git a/src/index.ts b/src/index.ts index 12d4235..7bd90f4 100644 --- a/src/index.ts +++ b/src/index.ts @@ -10,7 +10,7 @@ export { BoardContainer } from './data/BoardContainer' export { Biome, BlockType } from './procgen/Biome' export { EntitiesMap, RepeatableEntitiesMap } from './procgen/EntitiesMap' export { EntityType } from './common/types' -export { CacheContainer } from './data/CacheContainer' +export { CacheContainer as WorldCacheContainer } from './data/CacheContainer' export { WorldComputeApi } from './compute/WorldComputeApi' export * as WorldCompute from './compute/world-compute' export * as WorldUtils from './common/utils'