Don't save players with chunks!

I can't believe I didn't notice this
This commit is contained in:
Dylan K. Taylor 2017-08-30 16:55:17 +01:00
parent 23752548fe
commit b9c4a65307

View File

@ -38,6 +38,7 @@ use pocketmine\nbt\tag\{
ByteTag, CompoundTag, FloatTag, IntTag, LongTag, StringTag
};
use pocketmine\network\mcpe\protocol\ProtocolInfo;
use pocketmine\Player;
use pocketmine\tile\Tile;
use pocketmine\utils\Binary;
use pocketmine\utils\BinaryStream;
@ -501,7 +502,9 @@ class LevelDB extends BaseLevelProvider{
$this->db->put($index . self::TAG_STATE_FINALISATION, chr(self::FINALISATION_DONE));
$this->writeTags($chunk->getTiles(), $index . self::TAG_BLOCK_ENTITY);
$this->writeTags($chunk->getEntities(), $index . self::TAG_ENTITY);
$this->writeTags(array_filter($chunk->getEntities(), function(Entity $entity) : bool{
return !($entity instanceof Player);
}), $index . self::TAG_ENTITY);
$this->db->delete($index . self::TAG_DATA_2D_LEGACY);
$this->db->delete($index . self::TAG_LEGACY_TERRAIN);