mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-09-07 18:32:55 +00:00
Added support for compressing blockstate remaps using copiedState
this significantly reduces the size of schemas when state remaps are used (see pmmp/BedrockBlockUpgradeSchema@85b83b360e). in addition, this will likely offer a substantial performance and memory saving when walls get flattened, which will eventually happen.
This commit is contained in:
@ -43,15 +43,25 @@ final class BlockStateUpgradeSchemaModelBlockRemap{
|
||||
*/
|
||||
public ?array $newState;
|
||||
|
||||
/**
|
||||
* @var string[]
|
||||
* @phpstan-var list<string>
|
||||
* May not be present in older schemas
|
||||
*/
|
||||
public array $copiedState;
|
||||
|
||||
/**
|
||||
* @param BlockStateUpgradeSchemaModelTag[] $oldState
|
||||
* @param BlockStateUpgradeSchemaModelTag[] $newState
|
||||
* @param string[] $copiedState
|
||||
* @phpstan-param array<string, BlockStateUpgradeSchemaModelTag> $oldState
|
||||
* @phpstan-param array<string, BlockStateUpgradeSchemaModelTag> $newState
|
||||
* @phpstan-param list<string> $copiedState
|
||||
*/
|
||||
public function __construct(array $oldState, string $newName, array $newState){
|
||||
public function __construct(array $oldState, string $newName, array $newState, array $copiedState){
|
||||
$this->oldState = count($oldState) === 0 ? null : $oldState;
|
||||
$this->newName = $newName;
|
||||
$this->newState = count($newState) === 0 ? null : $newState;
|
||||
$this->copiedState = $copiedState;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user