Merge remote-tracking branch 'origin/stable'

# Conflicts:
#	resources/vanilla
#	src/pocketmine/entity/Entity.php
#	src/pocketmine/tile/Tile.php
#	tests/phpstan/configs/check-explicit-mixed-baseline.neon
#	tests/phpstan/configs/l7-baseline.neon
This commit is contained in:
Dylan K. Taylor
2020-11-12 22:10:47 +00:00
4 changed files with 28 additions and 43 deletions

View File

@ -42,8 +42,8 @@ final class TileFactory{
*/
private $knownTiles = [];
/**
* @var string[][]
* @phpstan-var array<class-string<Tile>, list<string>>
* @var string[]
* @phpstan-var array<class-string<Tile>, string>
*/
private $saveNames = [];
@ -108,7 +108,7 @@ final class TileFactory{
$this->knownTiles[$name] = $className;
}
$this->saveNames[$className] = $saveNames;
$this->saveNames[$className] = reset($saveNames);
}
/**
@ -136,7 +136,7 @@ final class TileFactory{
*/
public function getSaveId(string $class) : string{
if(isset($this->saveNames[$class])){
return reset($this->saveNames[$class]);
return $this->saveNames[$class];
}
throw new \InvalidArgumentException("Tile $class is not registered");
}