Question Would this work?

Discussion in 'Bukkit Help' started by Doubtstand, Jul 6, 2015.

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

    Doubtstand

    So I recently started to program with bukkit, but I don't have much experience.
    Can someone tell if this code will work? The goal is to always have it sunny in the server (no rain).

    My main class:

    public class Main extends JavaPlugin{

    public void onEnable(){
    new ChangeWeatherListener(this);
    }
    }

    My Listener class:

    public class ChangeWeatherListener implements Listener {

    public ChangeWeatherListener(Main plugin){
    plugin.getServer().getPluginManager().registerEvents(this, plugin);
    }

    @EventHandler
    public void onWeatherChange(WeatherChangeEvent e){
    World world = e.getWorld();
    world.setThundering(false);
    world.setStorm(false);
    }
    }
     
  2. Offline

    oceantheskatr

    First off, please encase your code in [.code=java] [/code] tags :) (Without the dot before code)

    Why do you ask if it will work? You should test it yourself to see if it works, then if not, post here ;)
     
Thread Status:
Not open for further replies.

Share This Page