setAllowFlight() 공개 메소드

public setAllowFlight ( $value )
예제 #1
0
 /**
  * Set the "flying" allowed status to a player
  *
  * @param Player $player
  * @param bool $mode
  * @return bool
  */
 public function setFlying(Player $player, $mode)
 {
     $this->getServer()->getPluginManager()->callEvent($ev = new PlayerFlyModeChangeEvent($this, $player, $mode));
     if ($ev->isCancelled()) {
         return false;
     }
     $player->setAllowFlight($ev->willFly());
     return true;
 }