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:
Dylan K. Taylor
2021-06-26 19:14:51 +01:00
parent 0910054c41
commit bf7d69b69e
43 changed files with 267 additions and 115 deletions

View File

@@ -25,6 +25,7 @@ namespace pocketmine\command\defaults;
use pocketmine\command\CommandSender;
use pocketmine\lang\TranslationContainer;
use pocketmine\permission\DefaultPermissionNames;
use pocketmine\plugin\Plugin;
use pocketmine\utils\TextFormat;
use function array_map;
@@ -42,7 +43,7 @@ class PluginsCommand extends VanillaCommand{
"%pocketmine.command.plugins.usage",
["pl"]
);
$this->setPermission("pocketmine.command.plugins");
$this->setPermission(DefaultPermissionNames::COMMAND_PLUGINS);
}
public function execute(CommandSender $sender, string $commandLabel, array $args){