mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-09-06 09:56:06 +00:00
Stop hardcoding permission names everywhere
using strings for permission names is nearly as shitty, but this is at least cross-referencable and statically analysable.
This commit is contained in:
@ -28,6 +28,7 @@ use pocketmine\command\CommandSender;
|
||||
use pocketmine\command\utils\InvalidCommandSyntaxException;
|
||||
use pocketmine\entity\Location;
|
||||
use pocketmine\lang\TranslationContainer;
|
||||
use pocketmine\permission\DefaultPermissionNames;
|
||||
use pocketmine\player\Player;
|
||||
use pocketmine\utils\AssumptionFailedError;
|
||||
use pocketmine\utils\TextFormat;
|
||||
@ -44,7 +45,7 @@ class TeleportCommand extends VanillaCommand{
|
||||
"%commands.tp.usage",
|
||||
["teleport"]
|
||||
);
|
||||
$this->setPermission("pocketmine.command.teleport");
|
||||
$this->setPermission(DefaultPermissionNames::COMMAND_TELEPORT);
|
||||
}
|
||||
|
||||
private function findPlayer(CommandSender $sender, string $playerName) : ?Player{
|
||||
|
Reference in New Issue
Block a user