mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-05-15 18:29:46 +00:00
Improved chunk saving times by not marking it as changed when Players are added/removed
This commit is contained in:
parent
c8b5c023cd
commit
7a0118820c
@ -766,8 +766,6 @@ abstract class Entity extends Location implements Metadatable{
|
||||
$this->despawnFromAll();
|
||||
if($this instanceof Player){
|
||||
foreach($this->usedChunks as $index => $d){
|
||||
$X = null;
|
||||
$Z = null;
|
||||
Level::getXZ($index, $X, $Z);
|
||||
$this->unloadChunk($X, $Z);
|
||||
}
|
||||
|
@ -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){
|
||||
|
Loading…
x
Reference in New Issue
Block a user