Skip to content

API reference / @jsprismarine/worldgen / CacheCell

Class: CacheCell ​

Defined in: density/SampleContext.ts:9

The memo slot of one compiled cache node: the last position it sampled and the value.

Constructors ​

Constructor ​

new CacheCell(): CacheCell

Returns ​

CacheCell

Properties ​

valid ​

valid: boolean = false

Defined in: density/SampleContext.ts:13


value ​

value: number = 0

Defined in: density/SampleContext.ts:14


x ​

x: number = 0

Defined in: density/SampleContext.ts:10


y ​

y: number = 0

Defined in: density/SampleContext.ts:11


z ​

z: number = 0

Defined in: density/SampleContext.ts:12

Methods ​

getColumnValue() ​

getColumnValue(context, input, x, z): number

Defined in: density/SampleContext.ts:21

Returns a cached value or samples the y-independent density node at Java's y=0 slice.

Parameters ​

context ​

SampleContext

input ​

DensitySampler

x ​

number

z ​

number

Returns ​

number


reset() ​

reset(): void

Defined in: density/SampleContext.ts:40

Drops values while retaining any lazily allocated column table.

Returns ​

void