Added LevelUnloadEvent

This commit is contained in:
Shoghi Cervantes
2014-07-06 00:06:03 +02:00
parent 81492acb0c
commit cbbdb42092
3 changed files with 46 additions and 0 deletions

View File

@ -840,11 +840,16 @@ class Server{
/**
* @param Level $level
* @param bool $forceUnload
*
* @return bool
*/
public function unloadLevel(Level $level, $forceUnload = false){
if($level->unload($forceUnload) === true and $this->isLevelLoaded($level->getFolderName())){
unset($this->levels[$level->getID()]);
return true;
}
return false;
}
/**