mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-04-22 16:51:42 +00:00
Level: rename unload to onUnload()
again, this is an intentional rug-jerk, along with a clearer naming.
This commit is contained in:
parent
bb286dea91
commit
1b572d3e40
@ -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);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -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");
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user