FallingBlock: fixed crash when block is unable to be determined

This commit is contained in:
Dylan K. Taylor 2021-12-06 16:40:32 +00:00
parent 62f150586f
commit 6e4b73c183
No known key found for this signature in database
GPG Key ID: 8927471A91CAFD3D

View File

@ -26,6 +26,7 @@ namespace pocketmine\entity\object;
use pocketmine\block\Block;
use pocketmine\block\BlockFactory;
use pocketmine\block\utils\Fallable;
use pocketmine\data\SavedDataLoadingException;
use pocketmine\entity\Entity;
use pocketmine\entity\EntitySizeInfo;
use pocketmine\entity\Location;
@ -71,7 +72,7 @@ class FallingBlock extends Entity{
}
if($blockId === 0){
throw new \UnexpectedValueException("Missing block info from NBT");
throw new SavedDataLoadingException("Missing block info from NBT");
}
$damage = $nbt->getByte("Data", 0);