Level: rename unload to onUnload()

again, this is an intentional rug-jerk, along with a clearer naming.
This commit is contained in:
Dylan K. Taylor 2018-10-13 15:43:43 +01:00
parent bb286dea91
commit 1b572d3e40
2 changed files with 2 additions and 4 deletions

View File

@ -999,7 +999,7 @@ class Server{
throw new \InvalidStateException("The default level cannot be unloaded while running, please switch levels."); throw new \InvalidStateException("The default level cannot be unloaded while running, please switch levels.");
} }
return $level->unload($forceUnload); return $level->onUnload($forceUnload);
} }
/** /**

View File

@ -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. * @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 * @param bool $force default false, force unload of default level
* *
* @return bool * @return bool
* @throws \InvalidStateException if trying to unload a level during level tick * @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){ if($this->doingTick and !$force){
throw new \InvalidStateException("Cannot unload a level during level tick"); throw new \InvalidStateException("Cannot unload a level during level tick");
} }