mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-09-07 02:08:21 +00:00
Fixed usages of BlockDataUpgrader which weren't accounting for thrown exceptions
This commit is contained in:
@ -52,7 +52,11 @@ class FlowerPot extends Spawnable{
|
||||
|
||||
$blockDataUpgrader = GlobalBlockStateHandlers::getUpgrader();
|
||||
if(($itemIdTag = $nbt->getTag(self::TAG_ITEM)) instanceof ShortTag && ($itemMetaTag = $nbt->getTag(self::TAG_ITEM_DATA)) instanceof IntTag){
|
||||
$blockStateData = $blockDataUpgrader->upgradeIntIdMeta($itemIdTag->getValue(), $itemMetaTag->getValue());
|
||||
try{
|
||||
$blockStateData = $blockDataUpgrader->upgradeIntIdMeta($itemIdTag->getValue(), $itemMetaTag->getValue());
|
||||
}catch(BlockStateDeserializeException $e){
|
||||
throw new SavedDataLoadingException("Error loading legacy flower pot item data: " . $e->getMessage(), 0, $e);
|
||||
}
|
||||
}elseif(($plantBlockTag = $nbt->getCompoundTag(self::TAG_PLANT_BLOCK)) !== null){
|
||||
try{
|
||||
$blockStateData = $blockDataUpgrader->upgradeBlockStateNbt($plantBlockTag);
|
||||
|
Reference in New Issue
Block a user