mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-09-06 01:46:04 +00:00
Fixed usages of BlockDataUpgrader which weren't accounting for thrown exceptions
This commit is contained in:
@ -67,9 +67,10 @@ abstract class BaseWorldProvider implements WorldProvider{
|
||||
|
||||
$newPalette = [];
|
||||
foreach($palette as $k => $legacyIdMeta){
|
||||
$newStateData = $this->blockDataUpgrader->upgradeIntIdMeta($legacyIdMeta >> 4, $legacyIdMeta & 0xf);
|
||||
if($newStateData === null){
|
||||
//TODO: remember data for unknown states so we can implement them later
|
||||
//TODO: remember data for unknown states so we can implement them later
|
||||
try{
|
||||
$newStateData = $this->blockDataUpgrader->upgradeIntIdMeta($legacyIdMeta >> 4, $legacyIdMeta & 0xf);
|
||||
}catch(BlockStateDeserializeException $e){
|
||||
$newStateData = GlobalBlockStateHandlers::getUnknownBlockStateData();
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user