mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-09-09 03:06:55 +00:00
First look at loading 1.13+ worlds
This commit is contained in:
@ -34,6 +34,16 @@ final class BlockStateUpgrader{
|
||||
/** @var BlockStateUpgradeSchema[][] */
|
||||
private array $upgradeSchemas = [];
|
||||
|
||||
/**
|
||||
* @param BlockStateUpgradeSchema[] $upgradeSchemas
|
||||
* @phpstan-param array<int, BlockStateUpgradeSchema> $upgradeSchemas
|
||||
*/
|
||||
public function __construct(array $upgradeSchemas){
|
||||
foreach($upgradeSchemas as $priority => $schema){
|
||||
$this->addSchema($schema, $priority);
|
||||
}
|
||||
}
|
||||
|
||||
public function addSchema(BlockStateUpgradeSchema $schema, int $priority) : void{
|
||||
if(isset($this->upgradeSchemas[$schema->getVersionId()][$priority])){
|
||||
throw new \InvalidArgumentException("Another schema already has this priority");
|
||||
|
Reference in New Issue
Block a user