Skip to content

twine / DatapackFactory

Class: DatapackFactory

Defined in: factory.ts:57

Bootstraps a Datapack from a root module - the NestJS-style NestFactory.create analogue. Every module reachable through the root's imports (and not pruned by env) is built once and wired into the pack.

area modules gate their whole subtree: their onTick and every descendant's onTick run only while the area's active flag is 1, nested so an inactive area costs a single check per tick. Areas also get <name>/activate and <name>/deactivate functions that flip the flag and run their onActivate/onDeactivate lifecycle.

Constructors

Constructor

new DatapackFactory(): DatapackFactory

Returns

DatapackFactory

Methods

create()

static create(root, opts): Datapack

Defined in: factory.ts:58

Parameters

root

ModuleClass

opts

FactoryOptions

Returns

Datapack

Released under the MIT License · Credits