Added pocketmine.yml option to disable the title ticker (#447)

This gets really spammy on some consoles when you stick it in the background, but I don't want to lose colour for the sake of that.
This commit is contained in:
Dylan K. Taylor 2017-03-24 16:03:10 +00:00 committed by GitHub
parent 96801be3d3
commit 0750b3ab59
2 changed files with 13 additions and 5 deletions

View File

@ -157,6 +157,9 @@ class Server{
private $currentTPS = 20;
private $currentUse = 0;
/** @var bool */
private $doTitleTick = true;
private $sendUsageTicker = 0;
private $dispatchSignals = false;
@ -1455,6 +1458,8 @@ class Server{
$this->alwaysTickPlayers = (int) $this->getProperty("level-settings.always-tick-players", false);
$this->baseTickRate = (int) $this->getProperty("level-settings.base-tick-rate", 1);
$this->doTitleTick = (bool) $this->getProperty("console.title-tick", true);
$this->scheduler = new ServerScheduler();
if($this->getConfigBoolean("enable-rcon", false) === true){
@ -2287,10 +2292,6 @@ class Server{
}
private function titleTick(){
if(!Terminal::hasFormattingCodes()){
return;
}
$d = Utils::getRealMemoryUsage();
$u = Utils::getMemoryUsage(true);
@ -2366,7 +2367,9 @@ class Server{
}
if(($this->tickCounter & 0b1111) === 0){
if($this->doTitleTick and Terminal::hasFormattingCodes()){
$this->titleTick();
}
$this->currentTPS = 20;
$this->currentUse = 0;

View File

@ -185,6 +185,11 @@ timings:
#Choose the host to use for viewing your timings results.
host: mcpetimings.com
console:
#Choose whether to enable server stats reporting on the console title.
#NOTE: The title ticker will be disabled regardless if console colours are not enabled.
title-tick: true
aliases:
#Examples:
#showtheversion: version