Split player into more methods, added extra timings

This commit is contained in:
Shoghi Cervantes
2015-06-05 00:19:31 +02:00
parent 188f4d7778
commit d542dfc2ce
4 changed files with 115 additions and 66 deletions

View File

@ -662,6 +662,10 @@ class Level implements ChunkManager, Metadatable{
Timings::$tickEntityTimer->stopTiming();
$this->timings->entityTick->stopTiming();
foreach($this->players as $player){
$player->checkNetwork();
}
$this->timings->tileEntityTick->startTiming();
Timings::$tickTileEntityTimer->startTiming();
//Update tiles that need update
@ -1697,7 +1701,7 @@ class Level implements ChunkManager, Metadatable{
for($x = $minX; $x <= $maxX; ++$x){
for($z = $minZ; $z <= $maxZ; ++$z){
foreach($this->getChunkEntities($x, $z) as $ent){
if($ent !== $entity and ($entity === null or $entity->canCollideWith($ent)) and $ent->boundingBox->intersectsWith($bb)){
if(($entity === null or ($ent !== $entity and $ent->canCollideWith($entity))) and $ent->boundingBox->intersectsWith($bb)){
$nearby[] = $ent;
}
}