mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-06-14 15:35:31 +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){
|
if($optimizeRebuilds){
|
||||||
$chunks = [];
|
$chunks = [];
|
||||||
foreach($blocks as $b){
|
foreach($blocks as $b){
|
||||||
$pk = new UpdateBlockPacket();
|
|
||||||
if($b === null){
|
if($b === null){
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
$pk = new UpdateBlockPacket();
|
||||||
|
|
||||||
$first = false;
|
$first = false;
|
||||||
if(!isset($chunks[$index = Level::chunkHash($b->x >> 4, $b->z >> 4)])){
|
if(!isset($chunks[$index = Level::chunkHash($b->x >> 4, $b->z >> 4)])){
|
||||||
@ -908,10 +908,10 @@ class Level implements ChunkManager, Metadatable{
|
|||||||
}
|
}
|
||||||
}else{
|
}else{
|
||||||
foreach($blocks as $b){
|
foreach($blocks as $b){
|
||||||
$pk = new UpdateBlockPacket();
|
|
||||||
if($b === null){
|
if($b === null){
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
$pk = new UpdateBlockPacket();
|
||||||
|
|
||||||
$pk->x = $b->x;
|
$pk->x = $b->x;
|
||||||
$pk->y = $b->y;
|
$pk->y = $b->y;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user