[API reference](https://jsprismarine.dev/api/index.md) / [@jsprismarine/native-worldgen](https://jsprismarine.dev/api/@jsprismarine/native-worldgen/index.md) / [NativeWorldgen](https://jsprismarine.dev/api/@jsprismarine/native-worldgen/NativeWorldgen/index.md) / NativeClimateSearch

# Class: NativeClimateSearch

Defined in: [NativeWorldgen.ts:815](https://github.com/JSPrismarine/JSPrismarine/blob/9db8dc5e83d04708d63ff9d73cae14f6c6b880f6/packages/native-worldgen/src/NativeWorldgen.ts#L815)

A climate search tree in native memory, made by [NativeWorldgen.createClimate](https://jsprismarine.dev/api/@jsprismarine/native-worldgen/NativeWorldgen/classes/NativeWorldgen.md#createclimate).

## Methods

### destroy()

> **destroy**(): `void`

Defined in: [NativeWorldgen.ts:859](https://github.com/JSPrismarine/JSPrismarine/blob/9db8dc5e83d04708d63ff9d73cae14f6c6b880f6/packages/native-worldgen/src/NativeWorldgen.ts#L859)

Frees the tree's native memory. Later calls throw.

#### Returns

`void`

***

### find()

> **find**(`candidate`, `temperature`, `humidity`, `continentalness`, `erosion`, `depth`, `weirdness`): `number`

Defined in: [NativeWorldgen.ts:836](https://github.com/JSPrismarine/JSPrismarine/blob/9db8dc5e83d04708d63ff9d73cae14f6c6b880f6/packages/native-worldgen/src/NativeWorldgen.ts#L836)

The leaf nearest a quantized climate target.

#### Parameters

##### candidate

`number`

The leaf the previous search returned, or -1.

##### temperature

`number`

##### humidity

`number`

##### continentalness

`number`

##### erosion

`number`

##### depth

`number`

##### weirdness

`number`

#### Returns

`number`

The leaf's node index, or -1 when the tree yields none.

#### Throws

After [destroy](#destroy).
