-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
toby7002
committed
Oct 1, 2023
1 parent
ec82f9a
commit bfc31a7
Showing
6 changed files
with
118 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,9 @@ | ||
{ | ||
"message.cache.running": "§eTask is running! Please wait until it is finished", | ||
"message.cache.failed": "§cCould not get Poggit plugins list from Poggit: {%reason}", | ||
"message.cache.successfully": "§a({%count}) Poggit plugins has been cached successfully" | ||
"text.cache.running": "§eTask is running! Please wait until it is finished", | ||
"text.cache.failed": "§cCould not get Poggit plugins list from Poggit: {%reason}", | ||
"text.cache.successfully": "§a({%count}) Poggit plugins has been cached successfully", | ||
|
||
"command.version.api_version": "§aPocketMine-MP API v{{version}}", | ||
"command.version.php_version": "§aPHP v{{version}}", | ||
"command.version.plugin_version": "§aoh-my-pmmp v{{version}}" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
37 changes: 37 additions & 0 deletions
37
src/thebigcrafter/omp/commands/subcommands/VersionCommand.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
<?php | ||
|
||
/* | ||
* This file is part of oh-my-pmmp. | ||
* (c) thebigcrafter <[email protected]> | ||
* This source file is subject to the GPL-3.0 license that is bundled | ||
* with this source code in the file LICENSE. | ||
*/ | ||
|
||
declare(strict_types=1); | ||
|
||
namespace thebigcrafter\omp\commands\subcommands; | ||
|
||
use CortexPE\Commando\BaseSubCommand; | ||
use pocketmine\command\CommandSender; | ||
use pocketmine\Server; | ||
use thebigcrafter\omp\OhMyPMMP; | ||
use function phpversion; | ||
|
||
class VersionCommand extends BaseSubCommand { | ||
protected function prepare() : void { | ||
$this->setPermission("oh-my-pmmp.version"); | ||
} | ||
|
||
/** | ||
* @param array<string> $args | ||
*/ | ||
public function onRun(CommandSender $sender,string $aliasUsed,array $args) : void { | ||
$apiVersion = Server::getInstance()->getApiVersion(); | ||
$phpVersion = phpversion(); | ||
$pluginVersion = OhMyPMMP::getInstance()->getDescription()->getVersion(); | ||
|
||
$sender->sendMessage(OhMyPMMP::getLanguage()->translate("command.version.api_version", ["version" => $apiVersion])); | ||
$sender->sendMessage(OhMyPMMP::getLanguage()->translate("command.version.php_version", ["version" => $phpVersion])); | ||
$sender->sendMessage(OhMyPMMP::getLanguage()->translate("command.version.plugin_version", ["version" => $pluginVersion])); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
<?php | ||
|
||
/* | ||
* This file is part of oh-my-pmmp. | ||
* (c) thebigcrafter <[email protected]> | ||
* This source file is subject to the GPL-3.0 license that is bundled | ||
* with this source code in the file LICENSE. | ||
*/ | ||
|
||
declare(strict_types=1); | ||
|
||
namespace thebigcrafter\omp\trait; | ||
|
||
use thebigcrafter\omp\lang\OMPLanguage; | ||
|
||
trait Language { | ||
private static OMPLanguage $language; | ||
|
||
public static function setLanguage(OMPLanguage $language) : void { | ||
self::$language = $language; | ||
} | ||
|
||
public static function getLanguage() : OMPLanguage { | ||
return self::$language; | ||
} | ||
} |