LevelDB: quick and dirty hack for air with bad metadata

this needs a proper solution, but this is a pressing issue that can't wait.
This commit is contained in:
Dylan K. Taylor 2020-10-03 16:41:26 +01:00
parent d0213f99ac
commit 9191e75392

View File

@ -169,6 +169,11 @@ class LevelDB extends BaseWorldProvider implements WritableWorldProvider{
$id = $idMap->stringToLegacy($tag->getString("name")) ?? BlockLegacyIds::INFO_UPDATE;
$data = $tag->getShort("val");
if($id === BlockLegacyIds::AIR){
//TODO: quick and dirty hack for artifacts left behind by broken world editors
//we really need a proper state fixer, but this is a pressing issue.
$data = 0;
}
$palette[] = ($id << 4) | $data;
}