mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-07-06 01:51:51 +00:00
LightArray: hide constants ZERO and FIFTEEN from the API
this makes it easier to implement this in C++ with the same API. Since the C++ version doesn't use strings, these constants aren't needed anyway.
This commit is contained in:
parent
01f8116cdd
commit
0fd3d91038
@ -56,10 +56,10 @@ class EmptySubChunk implements SubChunkInterface{
|
|||||||
}
|
}
|
||||||
|
|
||||||
public function getBlockLightArray() : LightArray{
|
public function getBlockLightArray() : LightArray{
|
||||||
return new LightArray(LightArray::ZERO);
|
return LightArray::fill(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getBlockSkyLightArray() : LightArray{
|
public function getBlockSkyLightArray() : LightArray{
|
||||||
return new LightArray(LightArray::FIFTEEN);
|
return LightArray::fill(15);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -39,8 +39,8 @@ if(!defined(__NAMESPACE__ . '\FIFTEEN_NIBBLE_ARRAY')){
|
|||||||
|
|
||||||
final class LightArray{
|
final class LightArray{
|
||||||
|
|
||||||
public const ZERO = ZERO_NIBBLE_ARRAY;
|
private const ZERO = ZERO_NIBBLE_ARRAY;
|
||||||
public const FIFTEEN = FIFTEEN_NIBBLE_ARRAY;
|
private const FIFTEEN = FIFTEEN_NIBBLE_ARRAY;
|
||||||
|
|
||||||
/** @var string */
|
/** @var string */
|
||||||
private $data;
|
private $data;
|
||||||
|
@ -46,8 +46,8 @@ class SubChunk implements SubChunkInterface{
|
|||||||
$this->defaultBlock = $default;
|
$this->defaultBlock = $default;
|
||||||
$this->blockLayers = $blocks;
|
$this->blockLayers = $blocks;
|
||||||
|
|
||||||
$this->skyLight = $skyLight ?? new LightArray(LightArray::FIFTEEN);
|
$this->skyLight = $skyLight ?? LightArray::fill(15);
|
||||||
$this->blockLight = $blockLight ?? new LightArray(LightArray::ZERO);
|
$this->blockLight = $blockLight ?? LightArray::fill(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function isEmptyAuthoritative() : bool{
|
public function isEmptyAuthoritative() : bool{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user