mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-06-26 05:14:05 +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.");
|
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.
|
* @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");
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user