@EventHandler
    public void onWeatherChange(WeatherChangeEvent event) {

        notifyAboutUpdate();

        Random r = new Random();
        Boolean voteInProgress = false;

        //Check if the world is enabled
        if (getFileConfig().getStringList("Worlds").contains(event.getWorld().getName())) {
            //Check if it's going to rain
            if (event.toWeatherState()) {


                if (getFileConfig().getInt("RainTime.longest") == 0) {
                    event.setCancelled(true);

                    LogDebug("Rain event cancelled.");

                    return;
                }


                //Check if there is a vote in progress in that world. Abort if so.
                for (VoteManager vote : voteManagers) {
                    if (vote.getVoteWorld().getName().equals(event.getWorld().getName())) {
                        voteInProgress = true;
                        continue;
                    }
                }

                LogDebug("Is vote in progress: " + voteInProgress + " " + event.getWorld().getName());

                if (voteInProgress) {
                    return;
                }

                if (r.nextInt(100) >= getFileConfig().getInt("FailChance")) {


                    VoteManager vm = new VoteManager(this, event.getWorld(), new WeatherInformation(event.getWorld(), event.toWeatherState(), event.toWeatherState(), event.getWorld().isThundering(), event.getWorld().getWeatherDuration(), event.getWorld().getThunderDuration()));

                    vm.startVote(getFileConfig().getInt("TimeToVote"));
                    voteManagers.add(vm);
                    event.setCancelled(true);
                } else {
                    messageAllPlayers(locale.getMessage("storm_too_strong"), event.getWorld());
                }
            } else {
                if (getFileConfig().getInt("SunTime.longest") == 0) {
                    event.setCancelled(true);

                    LogDebug("Sun event cancelled.");
                    return;
                }
                Integer duration;

                duration = r.nextInt((getFileConfig().getInt("SunTime.longest") - getFileConfig().getInt("SunTime.shortest")) + 1) + getFileConfig().getInt("SunTime.shortest");

                event.getWorld().setWeatherDuration(duration * 20);

                LogDebug("The sun will shine in " + event.getWorld().getName() + " for " + duration + " seconds.");
            }

        }
    }