mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-04-22 08:44:01 +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{
|
||||
return new LightArray(LightArray::ZERO);
|
||||
return LightArray::fill(0);
|
||||
}
|
||||
|
||||
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{
|
||||
|
||||
public const ZERO = ZERO_NIBBLE_ARRAY;
|
||||
public const FIFTEEN = FIFTEEN_NIBBLE_ARRAY;
|
||||
private const ZERO = ZERO_NIBBLE_ARRAY;
|
||||
private const FIFTEEN = FIFTEEN_NIBBLE_ARRAY;
|
||||
|
||||
/** @var string */
|
||||
private $data;
|
||||
|
@ -46,8 +46,8 @@ class SubChunk implements SubChunkInterface{
|
||||
$this->defaultBlock = $default;
|
||||
$this->blockLayers = $blocks;
|
||||
|
||||
$this->skyLight = $skyLight ?? new LightArray(LightArray::FIFTEEN);
|
||||
$this->blockLight = $blockLight ?? new LightArray(LightArray::ZERO);
|
||||
$this->skyLight = $skyLight ?? LightArray::fill(15);
|
||||
$this->blockLight = $blockLight ?? LightArray::fill(0);
|
||||
}
|
||||
|
||||
public function isEmptyAuthoritative() : bool{
|
||||
|
Loading…
x
Reference in New Issue
Block a user