World: Harden chunk loading against bad data in entity/tile NBT

This commit is contained in:
Dylan K. Taylor
2021-05-12 12:26:41 +01:00
parent 80e4da85df
commit b2e806e2fa
4 changed files with 36 additions and 19 deletions

View File

@ -24,6 +24,7 @@ declare(strict_types=1);
namespace pocketmine\block\tile;
use pocketmine\math\Vector3;
use pocketmine\nbt\NbtDataException;
use pocketmine\nbt\tag\CompoundTag;
use pocketmine\utils\SingletonTrait;
use pocketmine\utils\Utils;
@ -111,6 +112,7 @@ final class TileFactory{
/**
* @internal
* @throws NbtDataException
*/
public function createFromData(World $world, CompoundTag $nbt) : ?Tile{
$type = $nbt->getString(Tile::TAG_ID, "");