TimingsCommand: do not enable timings if they are already enabled

this causes timings to be reset, which is potentially undesirable (loss of already-collected timing data).
closes #4194
This commit is contained in:
Dylan K. Taylor 2021-04-27 22:39:13 +01:00
parent 8a3df1212a
commit 2bc0f9f7a2
No known key found for this signature in database
GPG Key ID: 8927471A91CAFD3D
2 changed files with 5 additions and 1 deletions

@ -1 +1 @@
Subproject commit 3d1c70b9f3d7650cef7cac25db27397a5708d22c
Subproject commit ca7fecaf24d8a8f9b947b69f1a8772475e03c379

View File

@ -75,6 +75,10 @@ class TimingsCommand extends VanillaCommand{
$mode = strtolower($args[0]);
if($mode === "on"){
if(TimingsHandler::isEnabled()){
$sender->sendMessage(new TranslationContainer("pocketmine.command.timings.alreadyEnabled"));
return true;
}
TimingsHandler::setEnabled();
Command::broadcastCommandMessage($sender, new TranslationContainer("pocketmine.command.timings.enable"));