Added KnownTranslationKeys (generated) and start using it

This commit is contained in:
Dylan K. Taylor
2021-06-29 22:46:04 +01:00
parent f02817bcd3
commit 94e16f416d
57 changed files with 802 additions and 286 deletions

View File

@ -27,6 +27,7 @@ use pocketmine\command\Command;
use pocketmine\command\CommandSender;
use pocketmine\command\utils\InvalidCommandSyntaxException;
use pocketmine\entity\Location;
use pocketmine\lang\KnownTranslationKeys;
use pocketmine\lang\TranslationContainer;
use pocketmine\permission\DefaultPermissionNames;
use pocketmine\player\Player;
@ -41,8 +42,8 @@ class TeleportCommand extends VanillaCommand{
public function __construct(string $name){
parent::__construct(
$name,
"%pocketmine.command.tp.description",
"%commands.tp.usage",
"%" . KnownTranslationKeys::POCKETMINE_COMMAND_TP_DESCRIPTION,
"%" . KnownTranslationKeys::COMMANDS_TP_USAGE,
["teleport"]
);
$this->setPermission(DefaultPermissionNames::COMMAND_TELEPORT);
@ -96,7 +97,7 @@ class TeleportCommand extends VanillaCommand{
}
$subject->teleport($targetPlayer->getLocation());
Command::broadcastCommandMessage($sender, new TranslationContainer("commands.tp.success", [$subject->getName(), $targetPlayer->getName()]));
Command::broadcastCommandMessage($sender, new TranslationContainer(KnownTranslationKeys::COMMANDS_TP_SUCCESS, [$subject->getName(), $targetPlayer->getName()]));
return true;
case 3:
@ -116,7 +117,7 @@ class TeleportCommand extends VanillaCommand{
$targetLocation = new Location($x, $y, $z, $yaw, $pitch, $base->getWorld());
$subject->teleport($targetLocation);
Command::broadcastCommandMessage($sender, new TranslationContainer("commands.tp.success.coordinates", [
Command::broadcastCommandMessage($sender, new TranslationContainer(KnownTranslationKeys::COMMANDS_TP_SUCCESS_COORDINATES, [
$subject->getName(),
round($targetLocation->x, 2),
round($targetLocation->y, 2),