Storm/Thunder doesn't work anymore?

Discussion in 'Plugin Development' started by Darkman2412, Oct 3, 2011.

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

    Darkman2412

    Hi!

    Is it me (again) or is it a bug in Bukkit?
    Code:
    plugin.nightworld.setStorm(true); // For normal rain
    
    plugin.nightworld.setThundering(true); // Thundering ;)
    plugin.nightworld.setThunderDuration(plugin.config.getNightDuration()*20*60); // Duration
    Soooo... Um... Is it me?

    Thanks in advance,
    Darkman2412
     
  2. How is nightworld initialized? Maybe you should store the worlds name only and get it with plugin.getServer().getWorld(worldName); later?
     
  3. Offline

    Darkman2412

    Code:
    if(getServer().getWorld(config.getDreamWorldName())==null) {
    	log.info("Attempting to create DreamWorld: " + config.getDreamWorldName());
    	WorldCreator dwc = new WorldCreator(config.getDreamWorldName());
    	dwc.environment(Environment.valueOf(config.getDreamWorldType()));
    	dwc.createWorld();
    }
    dreamworld = getServer().getWorld(config.getDreamWorldName());
    if(getServer().getWorld(config.getNightWorldName())==null) {
    	log.info("Attempting to create NightmareWorld: " + config.getNightWorldName());
    	WorldCreator nwc = new WorldCreator(config.getNightWorldName());
    	nwc.environment(Environment.valueOf(config.getNightWorldType()));
    	nightworld = nwc.createWorld();
    }
    nightworld = getServer().getWorld(config.getNightWorldName());
    I tried to replace the storm thingy to plugin.getServer().getWorld(plugin.config.getNightWorldName()).setStorm(true) but it's still doesn't work...

    Btw, if I start my server (not reload), does the getWorld() function work?

    @V10lator also, if I do the /thunder true on Essentials 2.2, it doesn't work either.

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: May 20, 2016
  4. When bukkit calls your onEnable() all worlds should be ready, so yes. When bukkit calls your onLoad(): I think i read somewhere: No.
     
Thread Status:
Not open for further replies.

Share This Page