WeatherRestrictions
Update: (September 30th, 2013) Entirely Re-coded plugin! Everything is brand new!
This is no longer a fork of the NoWeather Plugin! I designed it because it rains/snows too frequently on my server, yet I don't really want to put the weather on a schedule. This has several commands to start and stop storms (respects config file) as well as optional permissions support. If there is no permissions plugin the commands are OP only.
Note: As an entirely new, recoded version of the plugin, this should fix all the race conditions, etc. and should work on every server, large or small!
Features
- Can totally stop weather
- Toggles different aspects of the weather.
- An option to stop snow and/or ice from accumulating
- An option to make all storms thunder storms!
- Set the minimum delay before it can snow/rain again.
- Set the maximum time it can rain/snow.
- Set the max amount of time between the rainy times.
- Control the storms with admin commands
- Permissions support
- Configurable chance (disabled by default) Supercharged lightning strikes that will blow a hole in the ground.
- Configurable explosion radius
Commands
- /wr rain <world> and /rain <world> - Makes it rain in that world. Defaults to current world if no options given.
- /wr thunder <world> and /thunder <world> - Makes it start thundering in the current world. Defaults to current world if no options given.
- /wr lightning and /lightning - make a lightning bolt strike in a random locationwithin a radius of 10 blocks from you. (It has the same chance as being supercharged as regular lightning)
- /wr clear <world> and /clearrain or /rainclear <world> - Clears all thunder and rain from the world. Defaults to current world if no options given.
- /wr stats and /weatherstats - Gives you stats on the current weather in each world.
- /wr reload - Reloads the configuration file.
Permissions
- weatherRestrictions.rain - Can use /rain command
- weatherRestrictions.thunder - Can use /thunder command
- weatherRestrictions.clear - Can use /rainclear and /clearrain command
- weatherRestrictions.stats - Can use /weatherstats command
- weatherRestrictions.lightning - Can use the /lightning command
- weatherrestrictions.reload - Reload the configuration file
Config File Options
- CanRain - Set to false to disable all rain/snow in a world
- MaxSunTime - Maximum time to wait between storms in seconds.
- MinimumSunTime - Minimum amount of time in seconds between storms.
- MaxRainTime - Maximum time for a storm in seconds.
- MinimumRainTime - Minimum amount of time in seconds for a storm.
- CanSnowForm - if set to false will disable all snow accumulation in that world
- CanSnowMelt - if set to false will disable all snow melting in that world
- CanIceForm - if set to false will disable all ice accumulation in that world
- CanIceMelt - if set to false will disable all ice melting in that world
- ThunderstormChancePercentage - Sets the thunderstorm chance in the world. Set to 0 to disable thunderstorms.
- SuperchargedThunderChance - Set the percentage chance that a supercharged thunderbolt will blow a hole in the ground.
- SuperchargedExplosionRadius - Set the radius of the supercharged explosion
@PlayingwithBlocks
No stack trace, no fix...
Tried it on 1.3.2 (bukkit, moderately modified). Several times within a few hours my server would crash. Sorry I didn't copy down all the info, but I recall the last line being something about a fire event (I think caused by lightning) conflicting with ....essentials? Thought that was odd. Anyway, would love to have this level of control over weather, but we'll have to go with something simpler/less incompatible with other mods.
I've started a 1.3.1 server and ran WR without NoLagg. The server experienced a race condition within 24 hours, but without NL I have no way to determine who was at fault.
New thought: Could the race condition be caused by plugins that change the rate at which time passes in game? Maybe this is messing with the timing of your plugin?
Got the latest version. Still starts to lag my server like hell after some time. Here is the nolagg examine file:
https://www.dropbox.com/s/8fs8j5qxc6iwbro/2012_06_24-18_42_11.exam
Hey, just a thought: Could ProperTime or other plugins that change the length of the day/night cycle be causing the same even to be triggered repeatedly?
@Tux2
Yea, that's what puzzles me too. Yes, I stripped out all of the plugins except NoLaggChunk and still had the issue. I'm not sure how that one could be involved. He recently rewrote the whole thing, so perhaps I'll give it another go on a test server.
Thanks for looking into this.
@CommanderGizmo
Not dead, just stalled. I'm still wondering why the race condition is occurring... Did you have no-lagg installed when the race condition occurred?
Edit: Please be aware that I run this plugin in a production environment and my server almost never drops below 20 tps.
Is development of this plugin dead?
@Tux2
I have tested the newest version, but a race condition occurred within 5 hours. However, I updated two other small plugins that are not weather related and NoLagg just released a fully rewritten version that is more optimized. I will attempt to determine if WR was involved.
[EDIT] After another run, I have encountered a reduction in server performance such that the server is running at 13fps. Here's the timing file. As you can see, the only thing it shows as eating performance is WR. What do you make of this?
@TnTBass
Lol! Can you tell I was tired? Changed.
Thanks! I'll try it out.
Version 1.6.2, not 2.6.2?
@CommanderGizmo
Very strange indeed... I've been trying to figure out how exactly that race condition happens, yet I can't find it... especially when it puts a huge amount of scheduled tasks in... Running multiple threads is tricky with bukkit, yet more reliable than using the scheduler.
@Tux2
hmmm... Mine are all set to 600 still. I believe that the issue is that OnWeatherChange() is being called multiple times in an infinate loop. However, I cannot see why.
I did as you suggested and ran WR without any NoLagg plugins for 8 hours and did not see the race condition (though sometimes it takes longer to occur). After enabling only NoLaggChunks, the race condition occurred within 12 hours.
Is there any reason to suspect a connection with that plugin?
@CommanderGizmo
I have combed my plugin up and down to see where it could have an issue as described, and the only way for that to happen is if: you set the maximum delay between storms to 0, and the onWeatherChange() event was called multiple times in one tick. I've done a slight adjustment to my plugin to see if it solves the problem in version 2.6.2.
@Tux2
Rather that works or not, wouldn't it be prudent to find out what compatibility exists and fix it in either plugin? NoLagg is getting quite popular and is super handy. It is likely to continue to come up.
@CommanderGizmo
@_Greylocke_
Have you tried removing nolagg and seeing if the problem went away?
@Tux2
Any word man? I'm about to have to abandon this plugin all together. I just can't get it to work.