mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-09-06 17:59:48 +00:00
Cleaned up bool comparison mess
This commit is contained in:
@ -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){
|
||||
|
Reference in New Issue
Block a user