Skip to content

@pumpkin-plugins/distant-horizons-support-pumpkin API / lod/cache / LodCache

Class: LodCache ​

Defined in: packages/distant-horizons-support-pumpkin/src/lod/cache.ts:25

Persistent bounded cache; corrupt entries are discarded and rebuilt when terrain is available.

Methods ​

backupAndRemove() ​

backupAndRemove(key): CacheRecoveryBackup | undefined

Defined in: packages/distant-horizons-support-pumpkin/src/lod/cache.ts:101

Exports one selected entry, records its key, then removes it from the active cache.

Parameters ​

key ​

string

Returns ​

CacheRecoveryBackup | undefined


clear() ​

clear(): object

Defined in: packages/distant-horizons-support-pumpkin/src/lod/cache.ts:156

Drops both cache tiers and reports how many entries were removed from each.

Returns ​

object

diskEntries ​

diskEntries: number

memoryEntries ​

memoryEntries: number


clearDisk() ​

clearDisk(): number

Defined in: packages/distant-horizons-support-pumpkin/src/lod/cache.ts:150

Drops every persisted LOD file and returns how many were removed.

Returns ​

number


clearMemory() ​

clearMemory(): number

Defined in: packages/distant-horizons-support-pumpkin/src/lod/cache.ts:144

Drops every in-memory entry and returns how many were removed.

Returns ​

number


get() ​

get(key): CachedLod | undefined

Defined in: packages/distant-horizons-support-pumpkin/src/lod/cache.ts:46

Looks up a captured section, without allocating for oversized or corrupt files.

Parameters ​

key ​

string

Returns ​

CachedLod | undefined


has() ​

has(key): boolean

Defined in: packages/distant-horizons-support-pumpkin/src/lod/cache.ts:40

Checks for a stored capture without reading it into memory or changing its cache order.

Parameters ​

key ​

string

Returns ​

boolean


put() ​

put(key, value): void

Defined in: packages/distant-horizons-support-pumpkin/src/lod/cache.ts:83

Saves a complete capture atomically and evicts entries above their respective limits.

Parameters ​

key ​

string

value ​

CachedLod

Returns ​

void


remove() ​

remove(key): void

Defined in: packages/distant-horizons-support-pumpkin/src/lod/cache.ts:126

Invalidates a section affected by a known world change.

Parameters ​

key ​

string

Returns ​

void


stats() ​

stats(): LodCacheStats

Defined in: packages/distant-horizons-support-pumpkin/src/lod/cache.ts:131

Returns cache usage without reading or decoding disk entries.

Returns ​

LodCacheStats

Pumpkin Plugins documentation