[API reference](https://jsprismarine.dev/api/index.md) / [@jsprismarine/worldgen](https://jsprismarine.dev/api/@jsprismarine/worldgen/index.md) / CacheCell

# Class: CacheCell

Defined in: [density/SampleContext.ts:9](https://github.com/JSPrismarine/JSPrismarine/blob/9db8dc5e83d04708d63ff9d73cae14f6c6b880f6/packages/worldgen/src/density/SampleContext.ts#L9)

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](https://github.com/JSPrismarine/JSPrismarine/blob/9db8dc5e83d04708d63ff9d73cae14f6c6b880f6/packages/worldgen/src/density/SampleContext.ts#L13)

***

### value

> **value**: `number` = `0`

Defined in: [density/SampleContext.ts:14](https://github.com/JSPrismarine/JSPrismarine/blob/9db8dc5e83d04708d63ff9d73cae14f6c6b880f6/packages/worldgen/src/density/SampleContext.ts#L14)

***

### x

> **x**: `number` = `0`

Defined in: [density/SampleContext.ts:10](https://github.com/JSPrismarine/JSPrismarine/blob/9db8dc5e83d04708d63ff9d73cae14f6c6b880f6/packages/worldgen/src/density/SampleContext.ts#L10)

***

### y

> **y**: `number` = `0`

Defined in: [density/SampleContext.ts:11](https://github.com/JSPrismarine/JSPrismarine/blob/9db8dc5e83d04708d63ff9d73cae14f6c6b880f6/packages/worldgen/src/density/SampleContext.ts#L11)

***

### z

> **z**: `number` = `0`

Defined in: [density/SampleContext.ts:12](https://github.com/JSPrismarine/JSPrismarine/blob/9db8dc5e83d04708d63ff9d73cae14f6c6b880f6/packages/worldgen/src/density/SampleContext.ts#L12)

## Methods

### getColumnValue()

> **getColumnValue**(`context`, `input`, `x`, `z`): `number`

Defined in: [density/SampleContext.ts:21](https://github.com/JSPrismarine/JSPrismarine/blob/9db8dc5e83d04708d63ff9d73cae14f6c6b880f6/packages/worldgen/src/density/SampleContext.ts#L21)

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

#### Parameters

##### context

[`SampleContext`](https://jsprismarine.dev/api/@jsprismarine/worldgen/classes/SampleContext.md)

##### input

[`DensitySampler`](https://jsprismarine.dev/api/@jsprismarine/worldgen/index.md#densitysampler)

##### x

`number`

##### z

`number`

#### Returns

`number`

***

### reset()

> **reset**(): `void`

Defined in: [density/SampleContext.ts:40](https://github.com/JSPrismarine/JSPrismarine/blob/9db8dc5e83d04708d63ff9d73cae14f6c6b880f6/packages/worldgen/src/density/SampleContext.ts#L40)

Drops values while retaining any lazily allocated column table.

#### Returns

`void`
