mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-05-18 03:35:33 +00:00
BlockDataUpgrader: expose BlockIdMetaUpgrader via getter
This commit is contained in:
parent
afaf9dbc88
commit
b36b65927c
@ -30,16 +30,16 @@ use pocketmine\nbt\tag\CompoundTag;
|
||||
final class BlockDataUpgrader{
|
||||
|
||||
public function __construct(
|
||||
private BlockIdMetaUpgrader $legacyBlockStateMapper,
|
||||
private BlockIdMetaUpgrader $blockIdMetaUpgrader,
|
||||
private BlockStateUpgrader $blockStateUpgrader
|
||||
){}
|
||||
|
||||
public function upgradeIntIdMeta(int $id, int $meta) : ?BlockStateData{
|
||||
return $this->legacyBlockStateMapper->fromIntIdMeta($id, $meta);
|
||||
return $this->blockIdMetaUpgrader->fromIntIdMeta($id, $meta);
|
||||
}
|
||||
|
||||
public function upgradeStringIdMeta(string $id, int $meta) : ?BlockStateData{
|
||||
return $this->legacyBlockStateMapper->fromStringIdMeta($id, $meta);
|
||||
return $this->blockIdMetaUpgrader->fromStringIdMeta($id, $meta);
|
||||
}
|
||||
|
||||
public function upgradeBlockStateNbt(CompoundTag $tag) : ?BlockStateData{
|
||||
@ -62,4 +62,6 @@ final class BlockDataUpgrader{
|
||||
}
|
||||
|
||||
public function getBlockStateUpgrader() : BlockStateUpgrader{ return $this->blockStateUpgrader; }
|
||||
|
||||
public function getBlockIdMetaUpgrader() : BlockIdMetaUpgrader{ return $this->blockIdMetaUpgrader; }
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user