Cleaned up bool comparison mess

This commit is contained in:
Dylan K. Taylor
2018-03-19 14:10:55 +00:00
parent 24c5d7557e
commit ac5a91b67e
39 changed files with 141 additions and 141 deletions

View File

@ -272,7 +272,7 @@ class Server{
* @return bool
*/
public function isRunning() : bool{
return $this->isRunning === true;
return $this->isRunning;
}
/**
@ -1520,7 +1520,7 @@ class Server{
$this->scheduler = new ServerScheduler();
if($this->getConfigBool("enable-rcon", false) === true){
if($this->getConfigBool("enable-rcon", false)){
try{
$this->rcon = new RCON(
$this,
@ -1564,7 +1564,7 @@ class Server{
$this->logger->warning($this->getLanguage()->translateString("pocketmine.server.authProperty.disabled"));
}
if($this->getConfigBool("hardcore", false) === true and $this->getDifficulty() < Level::DIFFICULTY_HARD){
if($this->getConfigBool("hardcore", false) and $this->getDifficulty() < Level::DIFFICULTY_HARD){
$this->setConfigInt("difficulty", Level::DIFFICULTY_HARD);
}
@ -1639,7 +1639,7 @@ class Server{
if(!is_array($options)){
continue;
}
if($this->loadLevel($name) === false){
if(!$this->loadLevel($name)){
$seed = $options["seed"] ?? time();
if(is_string($seed) and !is_numeric($seed)){
$seed = Utils::javaStringHash($seed);
@ -1668,7 +1668,7 @@ class Server{
$default = "world";
$this->setConfigString("level-name", "world");
}
if($this->loadLevel($default) === false){
if(!$this->loadLevel($default)){
$seed = getopt("", ["level-seed::"])["level-seed"] ?? $this->properties->get("level-seed", time());
if(!is_numeric($seed) or bccomp($seed, "9223372036854775807") > 0){
$seed = Utils::javaStringHash($seed);
@ -1968,7 +1968,7 @@ class Server{
$this->properties->reload();
$this->maxPlayers = $this->getConfigInt("max-players", 20);
if($this->getConfigBool("hardcore", false) === true and $this->getDifficulty() < Level::DIFFICULTY_HARD){
if($this->getConfigBool("hardcore", false) and $this->getDifficulty() < Level::DIFFICULTY_HARD){
$this->setConfigInt("difficulty", Level::DIFFICULTY_HARD);
}
@ -2013,7 +2013,7 @@ class Server{
$this->rcon->stop();
}
if($this->getProperty("network.upnp-forwarding", false) === true){
if($this->getProperty("network.upnp-forwarding", false)){
$this->logger->info("[UPnP] Removing port forward...");
UPnP::RemovePortForward($this->getPort());
}
@ -2080,7 +2080,7 @@ class Server{
* Starts the PocketMine-MP server and starts processing ticks and packets
*/
private function start(){
if($this->getConfigBool("enable-query", true) === true){
if($this->getConfigBool("enable-query", true)){
$this->queryHandler = new QueryHandler();
}
@ -2162,7 +2162,7 @@ class Server{
}
public function crashDump(){
if($this->isRunning === false){
if(!$this->isRunning){
return;
}
if($this->sendUsageTicker > 0){