Documentation

BlockLightUpdate extends 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>>
$lightEmitters  : SplFixedArray|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
scanForLightEmittingBlocks()  : int

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}>

$lightEmitters

private SplFixedArray|array<string|int, int> $lightEmitters
Tags
phpstan-var

\SplFixedArray

Methods

__construct()

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

\SplFixedArray $lightFilters

phpstan-param

\SplFixedArray $lightEmitters

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 recalculateChunk(int $chunkX, int $chunkZ) : int

This erases preexisting light in the chunk.

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

recalculateNode()

public 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 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

scanForLightEmittingBlocks()

private scanForLightEmittingBlocks(SubChunk $subChunk, int $baseX, int $baseY, int $baseZ) : int
Parameters
$subChunk : SubChunk
$baseX : int
$baseY : int
$baseZ : int
Return values
int

Search results