Updated trigger_error to Exceptions, fixed bug in Plugin task deletion

This commit is contained in:
Shoghi Cervantes
2014-05-26 12:22:28 +02:00
parent ffa3e8a0aa
commit 160c633c08
15 changed files with 127 additions and 83 deletions

View File

@ -784,12 +784,12 @@ class Server{
* @param string $name
*
* @return bool
*
* @throws \Exception
*/
public function loadLevel($name){
if(trim($name) === ""){
trigger_error("Invalid empty level name", E_USER_WARNING);
return false;
throw new \Exception("Invalid empty level name");
}
if($this->isLevelLoaded($name)){
return true;
@ -1288,7 +1288,7 @@ class Server{
if($this->getDefaultLevel() === null){
$default = $this->getConfigString("level-name", "world");
if(trim($default) == ""){
trigger_error("level-name cannot be null", E_USER_WARNING);
trigger_error("level-name cannot be null, using default", E_USER_WARNING);
$default = "world";
$this->setConfigString("level-name", "world");
}