mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-05-12 16:59:44 +00:00
EmptySubChunk: get rid of useless allocations
This commit is contained in:
parent
bda9bd2f2d
commit
c1212eab8e
@ -23,8 +23,6 @@ declare(strict_types=1);
|
||||
|
||||
namespace pocketmine\world\format;
|
||||
|
||||
use function str_repeat;
|
||||
|
||||
class EmptySubChunk implements SubChunkInterface{
|
||||
/** @var EmptySubChunk */
|
||||
private static $instance;
|
||||
@ -74,7 +72,7 @@ class EmptySubChunk implements SubChunkInterface{
|
||||
}
|
||||
|
||||
public function getBlockLightArray() : LightArray{
|
||||
return new LightArray(str_repeat("\x00", 2048));
|
||||
return new LightArray(LightArray::ZERO);
|
||||
}
|
||||
|
||||
public function setBlockLightArray(LightArray $data) : void{
|
||||
@ -82,7 +80,7 @@ class EmptySubChunk implements SubChunkInterface{
|
||||
}
|
||||
|
||||
public function getBlockSkyLightArray() : LightArray{
|
||||
return new LightArray(str_repeat("\xff", 2048));
|
||||
return new LightArray(LightArray::FIFTEEN);
|
||||
}
|
||||
|
||||
public function setBlockSkyLightArray(LightArray $data) : void{
|
||||
|
Loading…
x
Reference in New Issue
Block a user