mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-05-13 01:09: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;
|
namespace pocketmine\world\format;
|
||||||
|
|
||||||
use function str_repeat;
|
|
||||||
|
|
||||||
class EmptySubChunk implements SubChunkInterface{
|
class EmptySubChunk implements SubChunkInterface{
|
||||||
/** @var EmptySubChunk */
|
/** @var EmptySubChunk */
|
||||||
private static $instance;
|
private static $instance;
|
||||||
@ -74,7 +72,7 @@ class EmptySubChunk implements SubChunkInterface{
|
|||||||
}
|
}
|
||||||
|
|
||||||
public function getBlockLightArray() : LightArray{
|
public function getBlockLightArray() : LightArray{
|
||||||
return new LightArray(str_repeat("\x00", 2048));
|
return new LightArray(LightArray::ZERO);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function setBlockLightArray(LightArray $data) : void{
|
public function setBlockLightArray(LightArray $data) : void{
|
||||||
@ -82,7 +80,7 @@ class EmptySubChunk implements SubChunkInterface{
|
|||||||
}
|
}
|
||||||
|
|
||||||
public function getBlockSkyLightArray() : LightArray{
|
public function getBlockSkyLightArray() : LightArray{
|
||||||
return new LightArray(str_repeat("\xff", 2048));
|
return new LightArray(LightArray::FIFTEEN);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function setBlockSkyLightArray(LightArray $data) : void{
|
public function setBlockSkyLightArray(LightArray $data) : void{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user