Improved chunk saving times by not marking it as changed when Players are added/removed

This commit is contained in:
Shoghi Cervantes
2015-01-04 23:07:08 +01:00
parent c8b5c023cd
commit 7a0118820c
2 changed files with 6 additions and 4 deletions

View File

@ -244,12 +244,16 @@ abstract class BaseFullChunk implements FullChunk{
public function addEntity(Entity $entity){
$this->entities[$entity->getId()] = $entity;
$this->hasChanged = true;
if(!($entity instanceof Player)){
$this->hasChanged = true;
}
}
public function removeEntity(Entity $entity){
unset($this->entities[$entity->getId()]);
$this->hasChanged = true;
if(!($entity instanceof Player)){
$this->hasChanged = true;
}
}
public function addTile(Tile $tile){