Solved onWeatherChange Acting Inconsistently?

Discussion in 'Plugin Development' started by LordDarthBob, Jan 22, 2015.

Thread Status:
Not open for further replies.
  1. Offline

    LordDarthBob

    Well, the title pretty much describes the issue. The onWeatherChange method in my plugin seems to be inconsistently preventing natural weather, if at all, with the occasional storm slipping through, and does not prevent plugins from setting the weather. (i.e /weather)

    onEnable:
    Code:
    @Override
        public void onEnable() {
            getServer().getPluginManager().registerEvents(this, this);
            plugin = this;
        }
    Event method:
    Code:
        @EventHandler
        public void onWeatherChange(WeatherChangeEvent event){
        
            reloadConfig();
            List<String> worlds = getConfig().getStringList("worlds");
        
            for (String s : worlds){
                if (event.getWorld().getName().equalsIgnoreCase(s)){
                    if (event.toWeatherState()){
                        event.setCancelled(true);
                        break;
                    }
                }
            }
        }
    Stack Traces/Other Symptoms of Technical Oversight:
    None

    Any assistance or advice is greatly appreciated.

    EDIT: This appears to be a ghost bug. Through extensive testing, I could not find any issues and the problem has not recurred. Marking this as solved until further notice.
     
    Last edited: Jan 22, 2015
Thread Status:
Not open for further replies.

Share This Page