removeAttachment() публичный Метод

public removeAttachment ( PermissionAttachment $attachment ) : boolean
$attachment pocketmine\permission\PermissionAttachment
Результат boolean
Пример #1
0
 public function resetPerms(Player $pl)
 {
     $n = strtolower($pl->getName());
     if (isset($this->perms[$n])) {
         $attach = $this->perms[$n];
         unset($this->perms[$n]);
         $pl->removeAttachment($attach);
         $pl->recalculatePermissions();
     }
 }
Пример #2
0
 public function resetPerms(Player $pl)
 {
     //echo  __METHOD__.",".__LINE__."\n";//##DEBUG
     $n = strtolower($pl->getName());
     if (isset($this->perms[$n])) {
         //echo __METHOD__.",".__LINE__."\n";//##DEBUG
         $attach = $this->perms[$n];
         unset($this->perms[$n]);
         $pl->removeAttachment($attach);
         $pl->recalculatePermissions();
     }
     //echo __METHOD__.",".__LINE__."\n";//##DEBUG
 }
Пример #3
0
 public function removeMember(Player $player)
 {
     if (in_array($player->getName(), $this->members)) {
         unset($this->members[array_search($player->getName(), $this->members)]);
         $this->getMain()->saveMembers();
         $attachment = $player->addAttachment($this->getMain()->getServer()->getPluginManager()->getPlugin("RankUp"));
         foreach ($this->permsToSet as $permToSet) {
             $attachment->unsetPermission($permToSet);
         }
         $player->removeAttachment($attachment);
         foreach ($this->exit as $cmd) {
             $this->getMain()->getServer()->dispatchCommand(new ConsoleCommandSender(), str_replace("{name}", $player->getName(), $cmd));
         }
     } else {
         return false;
     }
 }
Пример #4
0
 /**
  * @param Player $player
  */
 public function removeAttachment(Player $player)
 {
     $uuid = $player->getUniqueId();
     if (isset($this->attachments[$uuid]) and $this->attachments[$uuid] instanceof PermissionAttachment) {
         $player->removeAttachment($this->attachments[$uuid]);
         unset($this->attachments[$uuid]);
     }
 }
Пример #5
0
 /**
  * @param Player $player
  */
 public function unregisterPlayer(Player $player)
 {
     $this->getLogger()->debug($this->getMessage("logger_messages.unregisterPlayer", $player->getName()));
     $uniqueId = $player->getUniqueId()->toString();
     if (isset($this->attachments[$uniqueId])) {
         $player->removeAttachment($this->attachments[$uniqueId]);
     }
     unset($this->attachments[$uniqueId]);
 }
Пример #6
0
 /**
  * @param Player $player
  */
 public function removeAttachment(Player $player)
 {
     if (isset($this->attachments[$player->getUniqueId()])) {
         $player->removeAttachment($this->attachments[$player->getUniqueId()]);
         unset($this->attachments[$player->getUniqueId()]);
     }
 }
Пример #7
0
 public function removeAttachment(Player $player)
 {
     $player->removeAttachment($this->getAttachment($player));
     unset($this->attachment[$player->getName()]);
 }