PocketMine-MP 5.23.3 git-f7687af337d001ddbcc47b8e773f014a33faa662
|
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 70 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 332 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 264 of file WorldManager.php.
pocketmine\world\WorldManager::getAutoSave | ( | ) |
Definition at line 369 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 383 of file WorldManager.php.
pocketmine\world\WorldManager::getDefaultWorld | ( | ) |
Definition at line 88 of file WorldManager.php.
pocketmine\world\WorldManager::getProviderManager | ( | ) |
Definition at line 76 of file WorldManager.php.
pocketmine\world\WorldManager::getWorld | ( | int | $worldId | ) |
Definition at line 107 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 114 of file WorldManager.php.
pocketmine\world\WorldManager::getWorlds | ( | ) |
Definition at line 84 of file WorldManager.php.
pocketmine\world\WorldManager::isWorldGenerated | ( | string | $name | ) |
Definition at line 316 of file WorldManager.php.
pocketmine\world\WorldManager::isWorldLoaded | ( | string | $name | ) |
Definition at line 103 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 174 of file WorldManager.php.
pocketmine\world\WorldManager::setAutoSave | ( | bool | $value | ) |
Definition at line 373 of file WorldManager.php.
pocketmine\world\WorldManager::setAutoSaveInterval | ( | int | $autoSaveTicks | ) |
Definition at line 387 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 97 of file WorldManager.php.
pocketmine\world\WorldManager::tick | ( | int | $currentTick | ) |
Definition at line 343 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.