mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-09-07 10:22:56 +00:00
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:
@ -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");
|
||||
}
|
||||
|
Reference in New Issue
Block a user