ÂInsert PM data version into blockstates, chunks, entities, tiles and level.dat

this information will allow us to correct for any bugs introduced by past versions.

however, we still need to propagate this information to permit actually using it when loading data.
This commit is contained in:
Dylan K. Taylor
2023-05-29 16:32:24 +01:00
parent 7f1550ef04
commit f5a1a0c9cb
10 changed files with 42 additions and 3 deletions

View File

@ -34,6 +34,7 @@ use pocketmine\nbt\NbtDataException;
use pocketmine\nbt\tag\CompoundTag;
use pocketmine\timings\Timings;
use pocketmine\timings\TimingsHandler;
use pocketmine\VersionInfo;
use pocketmine\world\Position;
use pocketmine\world\World;
use function get_class;
@ -71,7 +72,8 @@ abstract class Tile{
->setString(self::TAG_ID, TileFactory::getInstance()->getSaveId(get_class($this)))
->setInt(self::TAG_X, $this->position->getFloorX())
->setInt(self::TAG_Y, $this->position->getFloorY())
->setInt(self::TAG_Z, $this->position->getFloorZ());
->setInt(self::TAG_Z, $this->position->getFloorZ())
->setLong(VersionInfo::TAG_WORLD_DATA_VERSION, VersionInfo::WORLD_DATA_VERSION);
$this->writeSaveData($nbt);
return $nbt;