PocketMine-MP/src/data/bedrock/blockstate/upgrade/BlockStateUpgradeSchema.php

71 lines
1.8 KiB
PHP

<?php
/*
*
* ____ _ _ __ __ _ __ __ ____
* | _ \ ___ ___| | _____| |_| \/ (_)_ __ ___ | \/ | _ \
* | |_) / _ \ / __| |/ / _ \ __| |\/| | | '_ \ / _ \_____| |\/| | |_) |
* | __/ (_) | (__| < __/ |_| | | | | | | | __/_____| | | | __/
* |_| \___/ \___|_|\_\___|\__|_| |_|_|_| |_|\___| |_| |_|_|
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* @author PocketMine Team
* @link http://www.pocketmine.net/
*
*
*/
declare(strict_types=1);
namespace pocketmine\data\bedrock\blockstate\upgrade;
use pocketmine\data\bedrock\blockstate\upgrade\BlockStateUpgradeSchemaValueRemap as ValueRemap;
use pocketmine\nbt\tag\Tag;
final class BlockStateUpgradeSchema{
/**
* @var string[]
* @phpstan-var array<string, string>
*/
public array $renamedIds = [];
/**
* @var Tag[][]
* @phpstan-var array<string, array<string, Tag>>
*/
public array $addedProperties = [];
/**
* @var string[][]
* @phpstan-var array<string, list<string>>
*/
public array $removedProperties = [];
/**
* @var string[][]
* @phpstan-var array<string, array<string, string>>
*/
public array $renamedProperties = [];
/**
* @var ValueRemap[][][]
* @phpstan-var array<string, array<string, list<ValueRemap>>>
*/
public array $remappedPropertyValues = [];
public function __construct(
public int $maxVersionMajor,
public int $maxVersionMinor,
public int $maxVersionPatch,
public int $maxVersionRevision
){}
public function getVersionId() : int{
return ($this->maxVersionMajor << 24) | ($this->maxVersionMinor << 16) | ($this->maxVersionPatch << 8) | $this->maxVersionRevision;
}
}