mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-06-06 20:07:09 +00:00
make use of getSavableEntities() in Level->unloadChunk()
why couldn't I have thought of this before I changed this the first time >.>
This commit is contained in:
parent
a9df383346
commit
00a9ae6c95
@ -2641,15 +2641,7 @@ class Level implements ChunkManager, Metadatable{
|
||||
try{
|
||||
if($chunk !== null){
|
||||
if($trySave and $this->getAutoSave() and $chunk->isGenerated()){
|
||||
$entities = 0;
|
||||
foreach($chunk->getEntities() as $e){
|
||||
if(!$e->canSaveWithChunk()){
|
||||
continue;
|
||||
}
|
||||
++$entities;
|
||||
}
|
||||
|
||||
if($chunk->hasChanged() or count($chunk->getTiles()) > 0 or $entities > 0){
|
||||
if($chunk->hasChanged() or count($chunk->getTiles()) > 0 or count($chunk->getSavableEntities()) > 0){
|
||||
$this->provider->setChunk($x, $z, $chunk);
|
||||
$this->provider->saveChunk($x, $z);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user