diff --git a/src/Buycraft/PocketMine/Execution/QueuedCommand.php b/src/Buycraft/PocketMine/Execution/QueuedCommand.php index 2968146..6371050 100644 --- a/src/Buycraft/PocketMine/Execution/QueuedCommand.php +++ b/src/Buycraft/PocketMine/Execution/QueuedCommand.php @@ -78,6 +78,7 @@ public function canExecute() public function getFinalCommand() { + $escaped = strpos($this->username, ' ') !== false ? '"' . $this->username . '"' : $this->username; $command = str_replace( [ '{name}', @@ -88,9 +89,9 @@ public function getFinalCommand() '{id}' ], [ - $this->username, - $this->username, - $this->username, + $escaped, + $escaped, + $escaped, $this->xuid, $this->xuid, $this->xuid, @@ -100,4 +101,4 @@ public function getFinalCommand() return $command; } -} \ No newline at end of file +}