mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-06-07 20:28:31 +00:00
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:
parent
8a3df1212a
commit
2bc0f9f7a2
@ -1 +1 @@
|
|||||||
Subproject commit 3d1c70b9f3d7650cef7cac25db27397a5708d22c
|
Subproject commit ca7fecaf24d8a8f9b947b69f1a8772475e03c379
|
@ -75,6 +75,10 @@ class TimingsCommand extends VanillaCommand{
|
|||||||
$mode = strtolower($args[0]);
|
$mode = strtolower($args[0]);
|
||||||
|
|
||||||
if($mode === "on"){
|
if($mode === "on"){
|
||||||
|
if(TimingsHandler::isEnabled()){
|
||||||
|
$sender->sendMessage(new TranslationContainer("pocketmine.command.timings.alreadyEnabled"));
|
||||||
|
return true;
|
||||||
|
}
|
||||||
TimingsHandler::setEnabled();
|
TimingsHandler::setEnabled();
|
||||||
Command::broadcastCommandMessage($sender, new TranslationContainer("pocketmine.command.timings.enable"));
|
Command::broadcastCommandMessage($sender, new TranslationContainer("pocketmine.command.timings.enable"));
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user