mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-05-13 09:19:42 +00:00
World: remove redundant checks
when entities are added and removed which are savable, the dirty flag is set anyway, so these checks aren't needed.
This commit is contained in:
parent
9e9de1e8ba
commit
211836274f
@ -1056,7 +1056,7 @@ class World implements ChunkManager, Metadatable{
|
|||||||
$this->timings->syncChunkSaveTimer->startTiming();
|
$this->timings->syncChunkSaveTimer->startTiming();
|
||||||
try{
|
try{
|
||||||
foreach($this->chunks as $chunk){
|
foreach($this->chunks as $chunk){
|
||||||
if(($chunk->hasChanged() or count($chunk->getTiles()) > 0 or count($chunk->getSavableEntities()) > 0) and $chunk->isGenerated()){
|
if($chunk->hasChanged() and $chunk->isGenerated()){
|
||||||
$this->provider->saveChunk($chunk);
|
$this->provider->saveChunk($chunk);
|
||||||
$chunk->setChanged(false);
|
$chunk->setChanged(false);
|
||||||
}
|
}
|
||||||
@ -2584,8 +2584,7 @@ class World implements ChunkManager, Metadatable{
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if($trySave and $this->getAutoSave() and $chunk->isGenerated()){
|
if($trySave and $this->getAutoSave() and $chunk->isGenerated() and $chunk->hasChanged()){
|
||||||
if($chunk->hasChanged() or count($chunk->getTiles()) > 0 or count($chunk->getSavableEntities()) > 0){
|
|
||||||
$this->timings->syncChunkSaveTimer->startTiming();
|
$this->timings->syncChunkSaveTimer->startTiming();
|
||||||
try{
|
try{
|
||||||
$this->provider->saveChunk($chunk);
|
$this->provider->saveChunk($chunk);
|
||||||
@ -2593,7 +2592,6 @@ class World implements ChunkManager, Metadatable{
|
|||||||
$this->timings->syncChunkSaveTimer->stopTiming();
|
$this->timings->syncChunkSaveTimer->stopTiming();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
foreach($this->getChunkListeners($x, $z) as $listener){
|
foreach($this->getChunkListeners($x, $z) as $listener){
|
||||||
$listener->onChunkUnloaded($chunk);
|
$listener->onChunkUnloaded($chunk);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user