Added API to allow flagging an entity not to be saved to disk when its chunk is saved (#1452)

This commit is contained in:
Dylan K. Taylor
2017-10-11 16:09:08 +01:00
committed by GitHub
parent 7b1bfc0520
commit be2d134994
6 changed files with 55 additions and 20 deletions

View File

@ -89,7 +89,7 @@ class McRegion extends BaseLevelProvider{
$entities = [];
foreach($chunk->getEntities() as $entity){
if(!($entity instanceof Player) and !$entity->isClosed()){
if($entity->canSaveWithChunk() and !$entity->isClosed()){
$entity->saveNBT();
$entities[] = $entity->namedtag;
}