Как мне удалить команды допустим ban так как при установке плагина он у меня не работает
1.1.х
просто удали строку с нужной команды из файла по пути src/pocketmine/command/SimpleCommandMap.php
1 симпатия
лучше так:
$commands = ["ban", "ban-ip"];
$map = $this->getServer()->getCommandMap();
foreach ($commands as $command)
$map->unregister($map->getCommand($command));
1 симпатия
Кнш так лучше, но ты думаешь он понял куда это пихать?)
В main.php
public function onEnable(){
$this->getServer()->getPluginManager()->registerEvents($this, $this);
$this->getServer()->getCommandMap()->getCommand("kick")->setLabel("kick__");
$this->getServer()->getCommandMap()->getCommand("kick")->unregister($this->getServer()->getCommandMap());
$this->getServer()->getCommandMap()->register("kick", new KickSystem($this));
$this->getServer()->getCommandMap()->getCommand("ban")->setLabel("ban__");
$this->getServer()->getCommandMap()->getCommand("ban")->unregister($this->getServer()->getCommandMap());
$this->getServer()->getCommandMap()->register("ban", new BanSystem($this));
$this->getServer()->getCommandMap()->getCommand("ban-ip")->setLabel("ban-ip__");
$this->getServer()->getCommandMap()->getCommand("ban-ip")->unregister($this->getServer()->getCommandMap());
$this->getServer()->getCommandMap()->register("ban-ip", new BanipSystem($this));
$this->getServer()->getCommandMap()->getCommand("bancid")->setLabel("bancid__");
$this->getServer()->getCommandMap()->getCommand("bancid")->unregister($this->getServer()->getCommandMap());
$this->getServer()->getCommandMap()->register("bancid", new BancidSystem($this));
$this->getServer()->getCommandMap()->getCommand("pardon")->setLabel("pardon__");
$this->getServer()->getCommandMap()->getCommand("pardon")->unregister($this->getServer()->getCommandMap());
$this->getServer()->getCommandMap()->register("pardon", new PardonSystem($this));
$this->getLogger()->info("Удаление команд из ядра...");
}
чел, удали лучше, пока тебя не засмеяли
$commands = ["ban", "ban-ip"];
$map = $this->getServer()->getCommandMap();
foreach ($commands as $command)
$map->unregister($map->getCommand($command));
1 симпатия
Я смотрю вы мне окончательно решили сломать мозги…
Че
пипец…
Фу это кто так навонял?
И зафиг заново их регистрировать? Ты вообще, я даже вспомнил откуда код с BanSystemApi там гкод от и до