Remap invalid metadata values to zero

this is a bit less sophisticated than the way we do it with BlockFactory, but this shouldn't usually have any relevance anyway - it's only used for correcting bogus states.
This commit is contained in:
Dylan K. Taylor 2022-03-28 18:13:14 +01:00
parent 53c2c4939e
commit 4c433fd75b
No known key found for this signature in database
GPG Key ID: 8927471A91CAFD3D

View File

@ -42,7 +42,7 @@ final class LegacyBlockStateMapper{
){}
public function fromStringIdMeta(string $id, int $meta) : ?BlockStateData{
return $this->mappingTable[$id][$meta] ?? null;
return $this->mappingTable[$id][$meta] ?? $this->mappingTable[$id][0] ?? null;
}
public function fromIntIdMeta(int $id, int $meta) : ?BlockStateData{