pocketmine\event\level\WeatherChangeEvent::getDuration PHP Method

getDuration() public method

public getDuration ( ) : integer
return integer
    public function getDuration() : int
    {
        return $this->duration;
    }

Usage Example

コード例 #1
0
 public function setWeather(int $wea, int $duration = 12000)
 {
     $this->level->getServer()->getPluginManager()->callEvent($ev = new WeatherChangeEvent($this->level, $wea, $duration));
     if (!$ev->isCancelled()) {
         $this->weatherNow = $ev->getWeather();
         $this->strength1 = mt_rand(90000, 110000);
         $this->strength2 = mt_rand(30000, 40000);
         $this->duration = $ev->getDuration();
         $this->changeWeather($wea, $this->strength1, $this->strength2);
     }
 }
All Usage Examples Of pocketmine\event\level\WeatherChangeEvent::getDuration