Stub PalettedBlockArray functions that work with arrays

and workaround PHPStan stupidity
This commit is contained in:
Dylan K. Taylor
2025-01-08 01:48:15 +00:00
parent 4a83920db9
commit 5e0f03dff0
3 changed files with 18 additions and 2 deletions

View File

@ -83,11 +83,11 @@ abstract class BaseWorldProvider implements WorldProvider{
}
try{
$newPalette[$k] = $this->blockStateDeserializer->deserialize($newStateData);
$newPalette[] = $this->blockStateDeserializer->deserialize($newStateData);
}catch(BlockStateDeserializeException $e){
//this should never happen anyway - if the upgrader returned an invalid state, we have bigger problems
$blockDecodeErrors[] = "Palette offset $k / Failed to deserialize upgraded state $id:$meta: " . $e->getMessage();
$newPalette[$k] = $this->blockStateDeserializer->deserialize(GlobalBlockStateHandlers::getUnknownBlockStateData());
$newPalette[] = $this->blockStateDeserializer->deserialize(GlobalBlockStateHandlers::getUnknownBlockStateData());
}
}