Documentation

LightUpdate
in package

Table of Contents

ADJACENTS  = [[1, 0, 0], [-1, 0, 0], [0, 1, 0], [0, -1, 0], [0, 0, 1], [0, 0, -1]]
$lightFilters  : SplFixedArray|array<string|int, int>
$subChunkExplorer  : SubChunkExplorer
$updateNodes  : array<string|int, array<string|int, int>>
__construct()  : mixed
execute()  : int
recalculateChunk()  : int
Scans for all light sources in the target chunk and adds them to the propagation queue.
recalculateNode()  : void
setAndUpdateLight()  : void
computeRemoveLight()  : void
computeSpreadLight()  : void
getCurrentLightArray()  : LightArray
getEffectiveLight()  : int
getHighestAdjacentLight()  : int
prepareNodes()  : LightPropagationContext

Constants

ADJACENTS

private mixed ADJACENTS = [[1, 0, 0], [-1, 0, 0], [0, 1, 0], [0, -1, 0], [0, 0, 1], [0, 0, -1]]

Properties

$lightFilters

protected SplFixedArray|array<string|int, int> $lightFilters
Tags
phpstan-var

\SplFixedArray

$updateNodes

protected array<string|int, array<string|int, int>> $updateNodes = []

blockhash => [x, y, z, new light level]

Tags
phpstan-var

array<int, array{int, int, int, int}>

Methods

__construct()

public __construct(SubChunkExplorer $subChunkExplorer, SplFixedArray|array<string|int, int> $lightFilters) : mixed
Parameters
$subChunkExplorer : SubChunkExplorer
$lightFilters : SplFixedArray|array<string|int, int>
Tags
phpstan-param

\SplFixedArray $lightFilters

Return values
mixed

execute()

public execute() : int
Return values
int

recalculateChunk()

Scans for all light sources in the target chunk and adds them to the propagation queue.

public abstract recalculateChunk(int $chunkX, int $chunkZ) : int

This erases preexisting light in the chunk.

Parameters
$chunkX : int
$chunkZ : int
Return values
int

recalculateNode()

public abstract recalculateNode(int $x, int $y, int $z) : void
Parameters
$x : int
$y : int
$z : int
Return values
void

setAndUpdateLight()

public setAndUpdateLight(int $x, int $y, int $z, int $newLevel) : void
Parameters
$x : int
$y : int
$z : int
$newLevel : int
Return values
void

getCurrentLightArray()

protected abstract getCurrentLightArray() : LightArray
Return values
LightArray

getEffectiveLight()

protected getEffectiveLight(int $x, int $y, int $z) : int
Parameters
$x : int
$y : int
$z : int
Return values
int

getHighestAdjacentLight()

protected getHighestAdjacentLight(int $x, int $y, int $z) : int
Parameters
$x : int
$y : int
$z : int
Return values
int

Search results