Fuck you git

This commit is contained in:
Dylan K. Taylor 2022-02-04 00:21:26 +00:00
parent 0cc997f531
commit 324d203f4e
No known key found for this signature in database
GPG Key ID: 8927471A91CAFD3D
3 changed files with 159 additions and 0 deletions

View File

@ -0,0 +1,83 @@
<?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\model;
use function count;
use function is_array;
/**
* Model for loading upgrade schema data from JSON.
*/
final class BlockStateUpgradeSchemaModel implements \JsonSerializable{
/** @required */
public int $maxVersionMajor;
/** @required */
public int $maxVersionMinor;
/** @required */
public int $maxVersionPatch;
/** @required */
public int $maxVersionRevision;
/**
* @var string[]
* @phpstan-var array<string, string>
*/
public array $renamedIds;
/**
* @var BlockStateUpgradeSchemaModelTag[][]
* @phpstan-var array<string, array<string, BlockStateUpgradeSchemaModelTag>>
*/
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 BlockStateUpgradeSchemaModelValueRemap[][][]
* @phpstan-var array<string, array<string, list<BlockStateUpgradeSchemaModelValueRemap>>>
*/
public array $remappedPropertyValues;
public function jsonSerialize() : array{
$result = (array) $this;
foreach($result as $k => $v){
if(is_array($v) && count($v) === 0){
unset($result[$k]);
}
}
return $result;
}
}

View File

@ -0,0 +1,40 @@
<?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\model;
final class BlockStateUpgradeSchemaModelTag{
/** @required */
public string $type;
/**
* @required
* @var mixed JsonMapper doesn't support mixed type :(
*/
public $value;
public function __construct(string $type, mixed $value){
$this->type = $type;
$this->value = $value;
}
}

View File

@ -0,0 +1,36 @@
<?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\model;
final class BlockStateUpgradeSchemaModelValueRemap{
/** @required */
public BlockStateUpgradeSchemaModelTag $old;
/** @required */
public BlockStateUpgradeSchemaModelTag $new;
public function __construct(BlockStateUpgradeSchemaModelTag $old, BlockStateUpgradeSchemaModelTag $new){
$this->old = $old;
$this->new = $new;
}
}