mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-05-16 18:59:00 +00:00
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:
parent
53c2c4939e
commit
4c433fd75b
@ -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{
|
||||
|
Loading…
x
Reference in New Issue
Block a user