mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-05-11 00:09:39 +00:00
Allow plugins to disable background generation (#2613)
This commit is contained in:
parent
78a80a6958
commit
f06e67a792
@ -1048,10 +1048,11 @@ class Server{
|
||||
* @param int|null $seed
|
||||
* @param string|null $generator Class name that extends pocketmine\level\generator\Generator
|
||||
* @param array $options
|
||||
* @param bool $backgroundGeneration
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function generateLevel(string $name, int $seed = null, $generator = null, array $options = []) : bool{
|
||||
public function generateLevel(string $name, int $seed = null, $generator = null, array $options = [], bool $backgroundGeneration = true) : bool{
|
||||
if(trim($name) === "" or $this->isLevelGenerated($name)){
|
||||
return false;
|
||||
}
|
||||
@ -1082,6 +1083,10 @@ class Server{
|
||||
|
||||
(new LevelLoadEvent($level))->call();
|
||||
|
||||
if(!$backgroundGeneration){
|
||||
return true;
|
||||
}
|
||||
|
||||
$this->getLogger()->notice($this->getLanguage()->translateString("pocketmine.level.backgroundGeneration", [$name]));
|
||||
|
||||
$spawnLocation = $level->getSpawnLocation();
|
||||
|
Loading…
x
Reference in New Issue
Block a user