mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-04-22 16:51:42 +00:00
Level: don't create objects which aren't going to be used
This commit is contained in:
parent
e3cae7364f
commit
9c786089f8
@ -878,10 +878,10 @@ class Level implements ChunkManager, Metadatable{
|
||||
if($optimizeRebuilds){
|
||||
$chunks = [];
|
||||
foreach($blocks as $b){
|
||||
$pk = new UpdateBlockPacket();
|
||||
if($b === null){
|
||||
continue;
|
||||
}
|
||||
$pk = new UpdateBlockPacket();
|
||||
|
||||
$first = false;
|
||||
if(!isset($chunks[$index = Level::chunkHash($b->x >> 4, $b->z >> 4)])){
|
||||
@ -908,10 +908,10 @@ class Level implements ChunkManager, Metadatable{
|
||||
}
|
||||
}else{
|
||||
foreach($blocks as $b){
|
||||
$pk = new UpdateBlockPacket();
|
||||
if($b === null){
|
||||
continue;
|
||||
}
|
||||
$pk = new UpdateBlockPacket();
|
||||
|
||||
$pk->x = $b->x;
|
||||
$pk->y = $b->y;
|
||||
|
Loading…
x
Reference in New Issue
Block a user