PocketMine-MP 5.21.2 git-a6534ecbbbcf369264567d27e5ed70f7f5be9816
|
Public Member Functions | |
__construct (private Server $server, private string $dataPath, private WorldProviderManager $providerManager) | |
findEntity (int $entityId) | |
generateWorld (string $name, WorldCreationOptions $options, bool $backgroundGeneration=true) | |
getAutoSave () | |
getAutoSaveInterval () | |
getDefaultWorld () | |
getProviderManager () | |
getWorld (int $worldId) | |
getWorldByName (string $name) | |
getWorlds () | |
isWorldGenerated (string $name) | |
isWorldLoaded (string $name) | |
loadWorld (string $name, bool $autoUpgrade=false) | |
setAutoSave (bool $value) | |
setAutoSaveInterval (int $autoSaveTicks) | |
setDefaultWorld (?World $world) | |
tick (int $currentTick) | |
unloadWorld (World $world, bool $forceUnload=false) | |
Public Attributes | |
const | TICKS_PER_AUTOSAVE = 300 * Server::TARGET_TICKS_PER_SECOND |
Definition at line 56 of file WorldManager.php.
pocketmine\world\WorldManager::__construct | ( | private Server | $server, |
private string | $dataPath, | ||
private WorldProviderManager | $providerManager ) |
Definition at line 67 of file WorldManager.php.
pocketmine\world\WorldManager::findEntity | ( | int | $entityId | ) |
Searches all worlds for the entity with the specified ID. Useful for tracking entities across multiple worlds without needing strong references.
Definition at line 328 of file WorldManager.php.
pocketmine\world\WorldManager::generateWorld | ( | string | $name, |
WorldCreationOptions | $options, | ||
bool | $backgroundGeneration = true ) |
Generates a new world if it does not exist
InvalidArgumentException
Definition at line 260 of file WorldManager.php.
pocketmine\world\WorldManager::getAutoSave | ( | ) |
Definition at line 365 of file WorldManager.php.
pocketmine\world\WorldManager::getAutoSaveInterval | ( | ) |
Returns the period in ticks after which loaded worlds will be automatically saved to disk.
Definition at line 379 of file WorldManager.php.
pocketmine\world\WorldManager::getDefaultWorld | ( | ) |
Definition at line 84 of file WorldManager.php.
pocketmine\world\WorldManager::getProviderManager | ( | ) |
Definition at line 73 of file WorldManager.php.
pocketmine\world\WorldManager::getWorld | ( | int | $worldId | ) |
Definition at line 103 of file WorldManager.php.
pocketmine\world\WorldManager::getWorldByName | ( | string | $name | ) |
NOTE: This matches worlds based on the FOLDER name, NOT the display name.
Definition at line 110 of file WorldManager.php.
pocketmine\world\WorldManager::getWorlds | ( | ) |
Definition at line 80 of file WorldManager.php.
pocketmine\world\WorldManager::isWorldGenerated | ( | string | $name | ) |
Definition at line 312 of file WorldManager.php.
pocketmine\world\WorldManager::isWorldLoaded | ( | string | $name | ) |
Definition at line 99 of file WorldManager.php.
pocketmine\world\WorldManager::loadWorld | ( | string | $name, |
bool | $autoUpgrade = false ) |
Loads a world from the data directory
bool | $autoUpgrade | Converts worlds to the default format if the world's format is not writable / deprecated |
WorldException |
Definition at line 170 of file WorldManager.php.
pocketmine\world\WorldManager::setAutoSave | ( | bool | $value | ) |
Definition at line 369 of file WorldManager.php.
pocketmine\world\WorldManager::setAutoSaveInterval | ( | int | $autoSaveTicks | ) |
Definition at line 383 of file WorldManager.php.
pocketmine\world\WorldManager::setDefaultWorld | ( | ?World | $world | ) |
Sets the default world to a different world This won't change the level-name property, it only affects the server on runtime
Definition at line 93 of file WorldManager.php.
pocketmine\world\WorldManager::tick | ( | int | $currentTick | ) |
Definition at line 339 of file WorldManager.php.
pocketmine\world\WorldManager::unloadWorld | ( | World | $world, |
bool | $forceUnload = false ) |
const pocketmine\world\WorldManager::TICKS_PER_AUTOSAVE = 300 * Server::TARGET_TICKS_PER_SECOND |
Definition at line 57 of file WorldManager.php.