public function onWeatherChange(WeatherEvent $event) { $level = $event->getLevel(); $everSun = $this->getConfig()->get("ever-sun"); $everRain = $this->getConfig()->get("ever-rain"); $everThundering = $this->getConfig()->get("ever-thundering"); if ($everSun === true && ($level->isRaining() || $level->isThundering())) { $level->setRaining(false); $level->setThundering(false); } elseif ($everRain === true && !($level->isRaining() || !$level->isThundering())) { $level->setThundering(false); } elseif ($everThundering === true && !($level->isRaining() || $level->isThundering())) { $level->setRaining(false); } }
public function __construct(Level $level, $to = false) { parent::__construct($level); $this->to = $to; }