Skip to content

@pumpkin-plugins/dynamic-lights-pumpkin API / lights/client-light / ClientLightTracker

Class: ClientLightTracker ​

Defined in: packages/dynamic-lights-pumpkin/src/lights/client-light.ts:60

Maintains client-only light blocks without ever changing the server world.

Methods ​

clear() ​

clear(): void

Defined in: packages/dynamic-lights-pumpkin/src/lights/client-light.ts:115

Forgets all temporary client lights when the server unloads the plugin.

Returns ​

void


forget() ​

forget(playerId): void

Defined in: packages/dynamic-lights-pumpkin/src/lights/client-light.ts:110

Forgets a previous client world without sending its block positions into the new world.

Parameters ​

playerId ​

string

Returns ​

void


replaceSources() ​

replaceSources(playerId, client, group, sources): void

Defined in: packages/dynamic-lights-pumpkin/src/lights/client-light.ts:71

Reconciles one source group, keeping the brightest source in every occupied cell.

Parameters ​

playerId ​

string

client ​

LightClient

group ​

string

sources ​

readonly PositionedLight[]

Returns ​

void


reset() ​

reset(playerId, client): void

Defined in: packages/dynamic-lights-pumpkin/src/lights/client-light.ts:104

Restores all client blocks for a player who disables lights or unloads the plugin.

Parameters ​

playerId ​

string

client ​

LightClient

Returns ​

void


sync() ​

sync(playerId, client, position, level): void

Defined in: packages/dynamic-lights-pumpkin/src/lights/client-light.ts:66

Updates one player's temporary light, or clears it when the light level is zero.

Parameters ​

playerId ​

string

client ​

LightClient

position ​

BlockPosition

level ​

number

Returns ​

void

pumpkin-plugins documentation