Skip to content

API reference / @jsprismarine/mcfunction / FunctionRegistry

Class: FunctionRegistry ​

Defined in: registry.ts:30

The functions a pack stack loaded, keyed by namespaced id.

Implements ​

Constructors ​

Constructor ​

new FunctionRegistry(): FunctionRegistry

Returns ​

FunctionRegistry

Accessors ​

size ​

Get Signature ​

get size(): number

Defined in: registry.ts:59

How many functions are registered.

Returns ​

number

Methods ​

add() ​

add(compiled, pack): void

Defined in: registry.ts:34

Registers a function, replacing whatever an earlier pack registered under the same id.

Parameters ​

compiled ​

CompiledFunction

pack ​

string

Returns ​

void


get() ​

get(id): CompiledFunction | undefined

Defined in: registry.ts:39

Returns the winning function for an id.

Parameters ​

id ​

string

Returns ​

CompiledFunction | undefined

Implementation of ​

FunctionLookup.get


has() ​

has(id): boolean

Defined in: registry.ts:44

Whether any pack registered the id.

Parameters ​

id ​

string

Returns ​

boolean


ids() ​

ids(): readonly string[]

Defined in: registry.ts:54

Every registered id, in registration order.

Returns ​

readonly string[]


packOf() ​

packOf(id): string | undefined

Defined in: registry.ts:49

The name of the pack whose file won the id.

Parameters ​

id ​

string

Returns ​

string | undefined