diff --git a/src/pocketmine/Server.php b/src/pocketmine/Server.php index 2f1f5b818..2dedebf33 100644 --- a/src/pocketmine/Server.php +++ b/src/pocketmine/Server.php @@ -999,7 +999,7 @@ class Server{ throw new \InvalidStateException("The default level cannot be unloaded while running, please switch levels."); } - return $level->unload($forceUnload); + return $level->onUnload($forceUnload); } /** diff --git a/src/pocketmine/level/Level.php b/src/pocketmine/level/Level.php index 2ef63effc..eb1356983 100644 --- a/src/pocketmine/level/Level.php +++ b/src/pocketmine/level/Level.php @@ -529,14 +529,12 @@ class Level implements ChunkManager, Metadatable{ /** * @internal DO NOT use this from plugins, it's for internal use only. Use Server->unloadLevel() instead. * - * Unloads the current level from memory safely - * * @param bool $force default false, force unload of default level * * @return bool * @throws \InvalidStateException if trying to unload a level during level tick */ - public function unload(bool $force = false) : bool{ + public function onUnload(bool $force = false) : bool{ if($this->doingTick and !$force){ throw new \InvalidStateException("Cannot unload a level during level tick"); }