mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-10-20 15:41:33 +00:00
Merge branch 'next-major' into modern-world-support
This commit is contained in:
@@ -28,13 +28,12 @@ namespace pocketmine\world\format\io;
|
||||
*/
|
||||
class ReadOnlyWorldProviderManagerEntry extends WorldProviderManagerEntry{
|
||||
|
||||
/** @phpstan-var FromPath */
|
||||
private \Closure $fromPath;
|
||||
|
||||
/** @phpstan-param FromPath $fromPath */
|
||||
public function __construct(\Closure $isValid, \Closure $fromPath){
|
||||
public function __construct(
|
||||
\Closure $isValid,
|
||||
private \Closure $fromPath
|
||||
){
|
||||
parent::__construct($isValid);
|
||||
$this->fromPath = $fromPath;
|
||||
}
|
||||
|
||||
public function fromPath(string $path) : WorldProvider{ return ($this->fromPath)($path); }
|
||||
|
@@ -31,13 +31,10 @@ use pocketmine\world\format\io\exception\UnsupportedWorldFormatException;
|
||||
*/
|
||||
abstract class WorldProviderManagerEntry{
|
||||
|
||||
/** @phpstan-var IsValid */
|
||||
protected \Closure $isValid;
|
||||
|
||||
/** @phpstan-param IsValid $isValid */
|
||||
protected function __construct(\Closure $isValid){
|
||||
$this->isValid = $isValid;
|
||||
}
|
||||
protected function __construct(
|
||||
protected \Closure $isValid
|
||||
){}
|
||||
|
||||
/**
|
||||
* Tells if the path is a valid world.
|
||||
|
@@ -30,19 +30,17 @@ use pocketmine\world\WorldCreationOptions;
|
||||
* @phpstan-type Generate \Closure(string $path, string $name, WorldCreationOptions $options) : void
|
||||
*/
|
||||
final class WritableWorldProviderManagerEntry extends WorldProviderManagerEntry{
|
||||
/** @phpstan-var FromPath */
|
||||
private \Closure $fromPath;
|
||||
/** @phpstan-var Generate */
|
||||
private \Closure $generate;
|
||||
|
||||
/**
|
||||
* @phpstan-param FromPath $fromPath
|
||||
* @phpstan-param Generate $generate
|
||||
*/
|
||||
public function __construct(\Closure $isValid, \Closure $fromPath, \Closure $generate){
|
||||
public function __construct(
|
||||
\Closure $isValid,
|
||||
private \Closure $fromPath,
|
||||
private \Closure $generate
|
||||
){
|
||||
parent::__construct($isValid);
|
||||
$this->fromPath = $fromPath;
|
||||
$this->generate = $generate;
|
||||
}
|
||||
|
||||
public function fromPath(string $path) : WritableWorldProvider{
|
||||
|
Reference in New Issue
Block a user