mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-06-08 04:38:35 +00:00
Adding some missed commands typehints and documentation
This commit is contained in:
parent
876659cc73
commit
592ce3c9e9
@ -31,7 +31,7 @@ use pocketmine\Player;
|
|||||||
|
|
||||||
class BanCommand extends VanillaCommand{
|
class BanCommand extends VanillaCommand{
|
||||||
|
|
||||||
public function __construct($name){
|
public function __construct(string $name){
|
||||||
parent::__construct(
|
parent::__construct(
|
||||||
$name,
|
$name,
|
||||||
"%pocketmine.command.ban.player.description",
|
"%pocketmine.command.ban.player.description",
|
||||||
|
@ -31,7 +31,7 @@ use pocketmine\Player;
|
|||||||
|
|
||||||
class BanIpCommand extends VanillaCommand{
|
class BanIpCommand extends VanillaCommand{
|
||||||
|
|
||||||
public function __construct($name){
|
public function __construct(string $name){
|
||||||
parent::__construct(
|
parent::__construct(
|
||||||
$name,
|
$name,
|
||||||
"%pocketmine.command.ban.ip.description",
|
"%pocketmine.command.ban.ip.description",
|
||||||
@ -71,7 +71,7 @@ class BanIpCommand extends VanillaCommand{
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
private function processIPBan($ip, CommandSender $sender, $reason){
|
private function processIPBan(string $ip, CommandSender $sender, string $reason){
|
||||||
$sender->getServer()->getIPBans()->addBan($ip, $reason, null, $sender->getName());
|
$sender->getServer()->getIPBans()->addBan($ip, $reason, null, $sender->getName());
|
||||||
|
|
||||||
foreach($sender->getServer()->getOnlinePlayers() as $player){
|
foreach($sender->getServer()->getOnlinePlayers() as $player){
|
||||||
|
@ -30,7 +30,7 @@ use pocketmine\permission\BanEntry;
|
|||||||
|
|
||||||
class BanListCommand extends VanillaCommand{
|
class BanListCommand extends VanillaCommand{
|
||||||
|
|
||||||
public function __construct($name){
|
public function __construct(string $name){
|
||||||
parent::__construct(
|
parent::__construct(
|
||||||
$name,
|
$name,
|
||||||
"%pocketmine.command.banlist.description",
|
"%pocketmine.command.banlist.description",
|
||||||
|
@ -30,7 +30,7 @@ use pocketmine\Server;
|
|||||||
|
|
||||||
class DefaultGamemodeCommand extends VanillaCommand{
|
class DefaultGamemodeCommand extends VanillaCommand{
|
||||||
|
|
||||||
public function __construct($name){
|
public function __construct(string $name){
|
||||||
parent::__construct(
|
parent::__construct(
|
||||||
$name,
|
$name,
|
||||||
"%pocketmine.command.defaultgamemode.description",
|
"%pocketmine.command.defaultgamemode.description",
|
||||||
|
@ -32,7 +32,7 @@ use pocketmine\utils\TextFormat;
|
|||||||
|
|
||||||
class DeopCommand extends VanillaCommand{
|
class DeopCommand extends VanillaCommand{
|
||||||
|
|
||||||
public function __construct($name){
|
public function __construct(string $name){
|
||||||
parent::__construct(
|
parent::__construct(
|
||||||
$name,
|
$name,
|
||||||
"%pocketmine.command.deop.description",
|
"%pocketmine.command.deop.description",
|
||||||
|
@ -32,7 +32,7 @@ use pocketmine\Server;
|
|||||||
|
|
||||||
class DifficultyCommand extends VanillaCommand{
|
class DifficultyCommand extends VanillaCommand{
|
||||||
|
|
||||||
public function __construct($name){
|
public function __construct(string $name){
|
||||||
parent::__construct(
|
parent::__construct(
|
||||||
$name,
|
$name,
|
||||||
"%pocketmine.command.difficulty.description",
|
"%pocketmine.command.difficulty.description",
|
||||||
|
@ -29,7 +29,7 @@ class DumpMemoryCommand extends VanillaCommand{
|
|||||||
|
|
||||||
private static $executions = 0;
|
private static $executions = 0;
|
||||||
|
|
||||||
public function __construct($name){
|
public function __construct(string $name){
|
||||||
parent::__construct(
|
parent::__construct(
|
||||||
$name,
|
$name,
|
||||||
"Dumps the memory",
|
"Dumps the memory",
|
||||||
|
@ -31,7 +31,7 @@ use pocketmine\utils\TextFormat;
|
|||||||
|
|
||||||
class EffectCommand extends VanillaCommand{
|
class EffectCommand extends VanillaCommand{
|
||||||
|
|
||||||
public function __construct($name){
|
public function __construct(string $name){
|
||||||
parent::__construct(
|
parent::__construct(
|
||||||
$name,
|
$name,
|
||||||
"%pocketmine.command.effect.description",
|
"%pocketmine.command.effect.description",
|
||||||
|
@ -31,7 +31,7 @@ use pocketmine\utils\TextFormat;
|
|||||||
|
|
||||||
class EnchantCommand extends VanillaCommand{
|
class EnchantCommand extends VanillaCommand{
|
||||||
|
|
||||||
public function __construct($name){
|
public function __construct(string $name){
|
||||||
parent::__construct(
|
parent::__construct(
|
||||||
$name,
|
$name,
|
||||||
"%pocketmine.command.enchant.description",
|
"%pocketmine.command.enchant.description",
|
||||||
|
@ -33,7 +33,7 @@ use pocketmine\utils\TextFormat;
|
|||||||
|
|
||||||
class GamemodeCommand extends VanillaCommand{
|
class GamemodeCommand extends VanillaCommand{
|
||||||
|
|
||||||
public function __construct($name){
|
public function __construct(string $name){
|
||||||
parent::__construct(
|
parent::__construct(
|
||||||
$name,
|
$name,
|
||||||
"%pocketmine.command.gamemode.description",
|
"%pocketmine.command.gamemode.description",
|
||||||
|
@ -28,7 +28,7 @@ use pocketmine\utils\TextFormat;
|
|||||||
|
|
||||||
class GarbageCollectorCommand extends VanillaCommand{
|
class GarbageCollectorCommand extends VanillaCommand{
|
||||||
|
|
||||||
public function __construct($name){
|
public function __construct(string $name){
|
||||||
parent::__construct(
|
parent::__construct(
|
||||||
$name,
|
$name,
|
||||||
"%pocketmine.command.gc.description",
|
"%pocketmine.command.gc.description",
|
||||||
|
@ -35,7 +35,7 @@ use pocketmine\utils\TextFormat;
|
|||||||
|
|
||||||
class GiveCommand extends VanillaCommand{
|
class GiveCommand extends VanillaCommand{
|
||||||
|
|
||||||
public function __construct($name){
|
public function __construct(string $name){
|
||||||
parent::__construct(
|
parent::__construct(
|
||||||
$name,
|
$name,
|
||||||
"%pocketmine.command.give.description",
|
"%pocketmine.command.give.description",
|
||||||
|
@ -30,7 +30,7 @@ use pocketmine\utils\TextFormat;
|
|||||||
|
|
||||||
class HelpCommand extends VanillaCommand{
|
class HelpCommand extends VanillaCommand{
|
||||||
|
|
||||||
public function __construct($name){
|
public function __construct(string $name){
|
||||||
parent::__construct(
|
parent::__construct(
|
||||||
$name,
|
$name,
|
||||||
"%pocketmine.command.help.description",
|
"%pocketmine.command.help.description",
|
||||||
|
@ -32,7 +32,7 @@ use pocketmine\utils\TextFormat;
|
|||||||
|
|
||||||
class KickCommand extends VanillaCommand{
|
class KickCommand extends VanillaCommand{
|
||||||
|
|
||||||
public function __construct($name){
|
public function __construct(string $name){
|
||||||
parent::__construct(
|
parent::__construct(
|
||||||
$name,
|
$name,
|
||||||
"%pocketmine.command.kick.description",
|
"%pocketmine.command.kick.description",
|
||||||
|
@ -33,7 +33,7 @@ use pocketmine\utils\TextFormat;
|
|||||||
|
|
||||||
class KillCommand extends VanillaCommand{
|
class KillCommand extends VanillaCommand{
|
||||||
|
|
||||||
public function __construct($name){
|
public function __construct(string $name){
|
||||||
parent::__construct(
|
parent::__construct(
|
||||||
$name,
|
$name,
|
||||||
"%pocketmine.command.kill.description",
|
"%pocketmine.command.kill.description",
|
||||||
|
@ -29,7 +29,7 @@ use pocketmine\Player;
|
|||||||
|
|
||||||
class ListCommand extends VanillaCommand{
|
class ListCommand extends VanillaCommand{
|
||||||
|
|
||||||
public function __construct($name){
|
public function __construct(string $name){
|
||||||
parent::__construct(
|
parent::__construct(
|
||||||
$name,
|
$name,
|
||||||
"%pocketmine.command.list.description",
|
"%pocketmine.command.list.description",
|
||||||
|
@ -31,7 +31,7 @@ use pocketmine\utils\TextFormat;
|
|||||||
|
|
||||||
class MeCommand extends VanillaCommand{
|
class MeCommand extends VanillaCommand{
|
||||||
|
|
||||||
public function __construct($name){
|
public function __construct(string $name){
|
||||||
parent::__construct(
|
parent::__construct(
|
||||||
$name,
|
$name,
|
||||||
"%pocketmine.command.me.description",
|
"%pocketmine.command.me.description",
|
||||||
|
@ -32,7 +32,7 @@ use pocketmine\utils\TextFormat;
|
|||||||
|
|
||||||
class OpCommand extends VanillaCommand{
|
class OpCommand extends VanillaCommand{
|
||||||
|
|
||||||
public function __construct($name){
|
public function __construct(string $name){
|
||||||
parent::__construct(
|
parent::__construct(
|
||||||
$name,
|
$name,
|
||||||
"%pocketmine.command.op.description",
|
"%pocketmine.command.op.description",
|
||||||
|
@ -30,7 +30,7 @@ use pocketmine\event\TranslationContainer;
|
|||||||
|
|
||||||
class PardonCommand extends VanillaCommand{
|
class PardonCommand extends VanillaCommand{
|
||||||
|
|
||||||
public function __construct($name){
|
public function __construct(string $name){
|
||||||
parent::__construct(
|
parent::__construct(
|
||||||
$name,
|
$name,
|
||||||
"%pocketmine.command.unban.player.description",
|
"%pocketmine.command.unban.player.description",
|
||||||
|
@ -30,7 +30,7 @@ use pocketmine\event\TranslationContainer;
|
|||||||
|
|
||||||
class PardonIpCommand extends VanillaCommand{
|
class PardonIpCommand extends VanillaCommand{
|
||||||
|
|
||||||
public function __construct($name){
|
public function __construct(string $name){
|
||||||
parent::__construct(
|
parent::__construct(
|
||||||
$name,
|
$name,
|
||||||
"%pocketmine.command.unban.ip.description",
|
"%pocketmine.command.unban.ip.description",
|
||||||
|
@ -64,7 +64,7 @@ use pocketmine\utils\TextFormat;
|
|||||||
|
|
||||||
class ParticleCommand extends VanillaCommand{
|
class ParticleCommand extends VanillaCommand{
|
||||||
|
|
||||||
public function __construct($name){
|
public function __construct(string $name){
|
||||||
parent::__construct(
|
parent::__construct(
|
||||||
$name,
|
$name,
|
||||||
"%pocketmine.command.particle.description",
|
"%pocketmine.command.particle.description",
|
||||||
@ -126,7 +126,6 @@ class ParticleCommand extends VanillaCommand{
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param string $name
|
* @param string $name
|
||||||
*
|
|
||||||
* @param Vector3 $pos
|
* @param Vector3 $pos
|
||||||
* @param float $xd
|
* @param float $xd
|
||||||
* @param float $yd
|
* @param float $yd
|
||||||
@ -135,7 +134,7 @@ class ParticleCommand extends VanillaCommand{
|
|||||||
*
|
*
|
||||||
* @return Particle|null
|
* @return Particle|null
|
||||||
*/
|
*/
|
||||||
private function getParticle($name, Vector3 $pos, $xd, $yd, $zd, $data){
|
private function getParticle(string $name, Vector3 $pos, float $xd, float $yd, float $zd, int $data = null){
|
||||||
switch($name){
|
switch($name){
|
||||||
case "explode":
|
case "explode":
|
||||||
return new ExplodeParticle($pos);
|
return new ExplodeParticle($pos);
|
||||||
|
@ -29,7 +29,7 @@ use pocketmine\utils\TextFormat;
|
|||||||
|
|
||||||
class PluginsCommand extends VanillaCommand{
|
class PluginsCommand extends VanillaCommand{
|
||||||
|
|
||||||
public function __construct($name){
|
public function __construct(string $name){
|
||||||
parent::__construct(
|
parent::__construct(
|
||||||
$name,
|
$name,
|
||||||
"%pocketmine.command.plugins.description",
|
"%pocketmine.command.plugins.description",
|
||||||
|
@ -30,7 +30,7 @@ use pocketmine\utils\TextFormat;
|
|||||||
|
|
||||||
class ReloadCommand extends VanillaCommand{
|
class ReloadCommand extends VanillaCommand{
|
||||||
|
|
||||||
public function __construct($name){
|
public function __construct(string $name){
|
||||||
parent::__construct(
|
parent::__construct(
|
||||||
$name,
|
$name,
|
||||||
"%pocketmine.command.reload.description",
|
"%pocketmine.command.reload.description",
|
||||||
|
@ -29,7 +29,7 @@ use pocketmine\event\TranslationContainer;
|
|||||||
|
|
||||||
class SaveCommand extends VanillaCommand{
|
class SaveCommand extends VanillaCommand{
|
||||||
|
|
||||||
public function __construct($name){
|
public function __construct(string $name){
|
||||||
parent::__construct(
|
parent::__construct(
|
||||||
$name,
|
$name,
|
||||||
"%pocketmine.command.save.description",
|
"%pocketmine.command.save.description",
|
||||||
|
@ -29,7 +29,7 @@ use pocketmine\event\TranslationContainer;
|
|||||||
|
|
||||||
class SaveOffCommand extends VanillaCommand{
|
class SaveOffCommand extends VanillaCommand{
|
||||||
|
|
||||||
public function __construct($name){
|
public function __construct(string $name){
|
||||||
parent::__construct(
|
parent::__construct(
|
||||||
$name,
|
$name,
|
||||||
"%pocketmine.command.saveoff.description",
|
"%pocketmine.command.saveoff.description",
|
||||||
|
@ -29,7 +29,7 @@ use pocketmine\event\TranslationContainer;
|
|||||||
|
|
||||||
class SaveOnCommand extends VanillaCommand{
|
class SaveOnCommand extends VanillaCommand{
|
||||||
|
|
||||||
public function __construct($name){
|
public function __construct(string $name){
|
||||||
parent::__construct(
|
parent::__construct(
|
||||||
$name,
|
$name,
|
||||||
"%pocketmine.command.saveon.description",
|
"%pocketmine.command.saveon.description",
|
||||||
|
@ -32,7 +32,7 @@ use pocketmine\utils\TextFormat;
|
|||||||
|
|
||||||
class SayCommand extends VanillaCommand{
|
class SayCommand extends VanillaCommand{
|
||||||
|
|
||||||
public function __construct($name){
|
public function __construct(string $name){
|
||||||
parent::__construct(
|
parent::__construct(
|
||||||
$name,
|
$name,
|
||||||
"%pocketmine.command.say.description",
|
"%pocketmine.command.say.description",
|
||||||
|
@ -29,7 +29,7 @@ use pocketmine\Player;
|
|||||||
|
|
||||||
class SeedCommand extends VanillaCommand{
|
class SeedCommand extends VanillaCommand{
|
||||||
|
|
||||||
public function __construct($name){
|
public function __construct(string $name){
|
||||||
parent::__construct(
|
parent::__construct(
|
||||||
$name,
|
$name,
|
||||||
"%pocketmine.command.seed.description",
|
"%pocketmine.command.seed.description",
|
||||||
|
@ -33,7 +33,7 @@ use pocketmine\utils\TextFormat;
|
|||||||
|
|
||||||
class SetWorldSpawnCommand extends VanillaCommand{
|
class SetWorldSpawnCommand extends VanillaCommand{
|
||||||
|
|
||||||
public function __construct($name){
|
public function __construct(string $name){
|
||||||
parent::__construct(
|
parent::__construct(
|
||||||
$name,
|
$name,
|
||||||
"%pocketmine.command.setworldspawn.description",
|
"%pocketmine.command.setworldspawn.description",
|
||||||
|
@ -34,7 +34,7 @@ use pocketmine\utils\TextFormat;
|
|||||||
|
|
||||||
class SpawnpointCommand extends VanillaCommand{
|
class SpawnpointCommand extends VanillaCommand{
|
||||||
|
|
||||||
public function __construct($name){
|
public function __construct(string $name){
|
||||||
parent::__construct(
|
parent::__construct(
|
||||||
$name,
|
$name,
|
||||||
"%pocketmine.command.spawnpoint.description",
|
"%pocketmine.command.spawnpoint.description",
|
||||||
|
@ -29,7 +29,7 @@ use pocketmine\utils\Utils;
|
|||||||
|
|
||||||
class StatusCommand extends VanillaCommand{
|
class StatusCommand extends VanillaCommand{
|
||||||
|
|
||||||
public function __construct($name){
|
public function __construct(string $name){
|
||||||
parent::__construct(
|
parent::__construct(
|
||||||
$name,
|
$name,
|
||||||
"%pocketmine.command.status.description",
|
"%pocketmine.command.status.description",
|
||||||
|
@ -29,7 +29,7 @@ use pocketmine\event\TranslationContainer;
|
|||||||
|
|
||||||
class StopCommand extends VanillaCommand{
|
class StopCommand extends VanillaCommand{
|
||||||
|
|
||||||
public function __construct($name){
|
public function __construct(string $name){
|
||||||
parent::__construct(
|
parent::__construct(
|
||||||
$name,
|
$name,
|
||||||
"%pocketmine.command.stop.description",
|
"%pocketmine.command.stop.description",
|
||||||
|
@ -33,7 +33,7 @@ use pocketmine\utils\TextFormat;
|
|||||||
|
|
||||||
class TeleportCommand extends VanillaCommand{
|
class TeleportCommand extends VanillaCommand{
|
||||||
|
|
||||||
public function __construct($name){
|
public function __construct(string $name){
|
||||||
parent::__construct(
|
parent::__construct(
|
||||||
$name,
|
$name,
|
||||||
"%pocketmine.command.tp.description",
|
"%pocketmine.command.tp.description",
|
||||||
|
@ -31,7 +31,7 @@ use pocketmine\utils\TextFormat;
|
|||||||
|
|
||||||
class TellCommand extends VanillaCommand{
|
class TellCommand extends VanillaCommand{
|
||||||
|
|
||||||
public function __construct($name){
|
public function __construct(string $name){
|
||||||
parent::__construct(
|
parent::__construct(
|
||||||
$name,
|
$name,
|
||||||
"%pocketmine.command.tell.description",
|
"%pocketmine.command.tell.description",
|
||||||
|
@ -33,7 +33,7 @@ use pocketmine\utils\TextFormat;
|
|||||||
|
|
||||||
class TimeCommand extends VanillaCommand{
|
class TimeCommand extends VanillaCommand{
|
||||||
|
|
||||||
public function __construct($name){
|
public function __construct(string $name){
|
||||||
parent::__construct(
|
parent::__construct(
|
||||||
$name,
|
$name,
|
||||||
"%pocketmine.command.time.description",
|
"%pocketmine.command.time.description",
|
||||||
|
@ -35,7 +35,7 @@ class TimingsCommand extends VanillaCommand{
|
|||||||
|
|
||||||
public static $timingStart = 0;
|
public static $timingStart = 0;
|
||||||
|
|
||||||
public function __construct($name){
|
public function __construct(string $name){
|
||||||
parent::__construct(
|
parent::__construct(
|
||||||
$name,
|
$name,
|
||||||
"%pocketmine.command.timings.description",
|
"%pocketmine.command.timings.description",
|
||||||
|
@ -29,7 +29,7 @@ use pocketmine\event\TranslationContainer;
|
|||||||
|
|
||||||
class TitleCommand extends VanillaCommand{
|
class TitleCommand extends VanillaCommand{
|
||||||
|
|
||||||
public function __construct($name){
|
public function __construct(string $name){
|
||||||
parent::__construct(
|
parent::__construct(
|
||||||
$name,
|
$name,
|
||||||
"%pocketmine.command.title.description",
|
"%pocketmine.command.title.description",
|
||||||
|
@ -31,7 +31,7 @@ use pocketmine\Player;
|
|||||||
|
|
||||||
class TransferServerCommand extends VanillaCommand{
|
class TransferServerCommand extends VanillaCommand{
|
||||||
|
|
||||||
public function __construct($name){
|
public function __construct(string $name){
|
||||||
parent::__construct(
|
parent::__construct(
|
||||||
$name,
|
$name,
|
||||||
"%pocketmine.command.transferserver.description",
|
"%pocketmine.command.transferserver.description",
|
||||||
|
@ -30,11 +30,15 @@ abstract class VanillaCommand extends Command{
|
|||||||
const MAX_COORD = 30000000;
|
const MAX_COORD = 30000000;
|
||||||
const MIN_COORD = -30000000;
|
const MIN_COORD = -30000000;
|
||||||
|
|
||||||
public function __construct($name, $description = "", $usageMessage = null, array $aliases = []){
|
/**
|
||||||
parent::__construct($name, $description, $usageMessage, $aliases);
|
* @param CommandSender $sender
|
||||||
}
|
* @param mixed $value
|
||||||
|
* @param int $min
|
||||||
protected function getInteger(CommandSender $sender, $value, $min = self::MIN_COORD, $max = self::MAX_COORD){
|
* @param int $max
|
||||||
|
*
|
||||||
|
* @return int
|
||||||
|
*/
|
||||||
|
protected function getInteger(CommandSender $sender, $value, int $min = self::MIN_COORD, int $max = self::MAX_COORD) : int{
|
||||||
$i = (int) $value;
|
$i = (int) $value;
|
||||||
|
|
||||||
if($i < $min){
|
if($i < $min){
|
||||||
@ -46,7 +50,16 @@ abstract class VanillaCommand extends Command{
|
|||||||
return $i;
|
return $i;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function getRelativeDouble($original, CommandSender $sender, $input, $min = self::MIN_COORD, $max = self::MAX_COORD){
|
/**
|
||||||
|
* @param float $original
|
||||||
|
* @param CommandSender $sender
|
||||||
|
* @param string $input
|
||||||
|
* @param float $min
|
||||||
|
* @param float $max
|
||||||
|
*
|
||||||
|
* @return float
|
||||||
|
*/
|
||||||
|
protected function getRelativeDouble(float $original, CommandSender $sender, string $input, float $min = self::MIN_COORD, float $max = self::MAX_COORD) : float{
|
||||||
if($input{0} === "~"){
|
if($input{0} === "~"){
|
||||||
$value = $this->getDouble($sender, substr($input, 1));
|
$value = $this->getDouble($sender, substr($input, 1));
|
||||||
|
|
||||||
@ -56,7 +69,15 @@ abstract class VanillaCommand extends Command{
|
|||||||
return $this->getDouble($sender, $input, $min, $max);
|
return $this->getDouble($sender, $input, $min, $max);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function getDouble(CommandSender $sender, $value, $min = self::MIN_COORD, $max = self::MAX_COORD){
|
/**
|
||||||
|
* @param CommandSender $sender
|
||||||
|
* @param mixed $value
|
||||||
|
* @param float $min
|
||||||
|
* @param float $max
|
||||||
|
*
|
||||||
|
* @return float
|
||||||
|
*/
|
||||||
|
protected function getDouble(CommandSender $sender, $value, float $min = self::MIN_COORD, float $max = self::MAX_COORD) : float{
|
||||||
$i = (double) $value;
|
$i = (double) $value;
|
||||||
|
|
||||||
if($i < $min){
|
if($i < $min){
|
||||||
|
@ -31,7 +31,7 @@ use pocketmine\utils\TextFormat;
|
|||||||
|
|
||||||
class VersionCommand extends VanillaCommand{
|
class VersionCommand extends VanillaCommand{
|
||||||
|
|
||||||
public function __construct($name){
|
public function __construct(string $name){
|
||||||
parent::__construct(
|
parent::__construct(
|
||||||
$name,
|
$name,
|
||||||
"%pocketmine.command.version.description",
|
"%pocketmine.command.version.description",
|
||||||
|
@ -31,7 +31,7 @@ use pocketmine\utils\TextFormat;
|
|||||||
|
|
||||||
class WhitelistCommand extends VanillaCommand{
|
class WhitelistCommand extends VanillaCommand{
|
||||||
|
|
||||||
public function __construct($name){
|
public function __construct(string $name){
|
||||||
parent::__construct(
|
parent::__construct(
|
||||||
$name,
|
$name,
|
||||||
"%pocketmine.command.whitelist.description",
|
"%pocketmine.command.whitelist.description",
|
||||||
@ -108,7 +108,7 @@ class WhitelistCommand extends VanillaCommand{
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
private function badPerm(CommandSender $sender, $perm){
|
private function badPerm(CommandSender $sender, string $perm) : bool{
|
||||||
if(!$sender->hasPermission("pocketmine.command.whitelist.$perm")){
|
if(!$sender->hasPermission("pocketmine.command.whitelist.$perm")){
|
||||||
$sender->sendMessage(new TranslationContainer(TextFormat::RED . "%commands.generic.permission"));
|
$sender->sendMessage(new TranslationContainer(TextFormat::RED . "%commands.generic.permission"));
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user