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
@CommanderGizmo
Would you believe me if I said that maybe NoLagg might be interfering with WeatherRestrictions? Remember, I run WeatherRestrictions on a production server with up to 18 players on at once with no CPU race conditions for over 6 hours. If it is NoLagg I'll see about getting a fix out.
Just did a test with WR in place and SnoGro removed. CPU race condition occurred within 2 hours. No race conditions have occurred after a week of running SnoGro without WR.
Seems pretty clear that WR is the issue in my case. I can send timings and NoLaggExamine files if needed.
Not to seem too impatient, but this bug is preventing the roll out of my server update. From what I can surmise, it seems possible that WR is generating a weather update event and perhaps one of the other plugins then sees it and counters with another weather update, which WR sees and corrects with another and so on... That, of course, assumes that WR listens for weather updates and issues it's own to counter if WR wasn't the source; as well as issuing it's own weather events.
But SnoGrow is supposed to only respond to events in weather, not update them. Do any other plugins I listed look likely to be causing the interaction?
Or maybe I'm way off base...
Hey, I have been experiencing high CPU usage on my server seemingly randomly even when no one has been on for some time. I used NoLaggExamine to try and determine the cause, and it came up with WeatherRestrictions using a massive amount of processing per tick (over 539ms per tick). It appears to be used by WeatherChangeEvent, though ThunderChangeEvent is using 274ms per tick, which is also quite high.
I'm not sure if this could be caused by some other plugin interfering, but I was hoping you might have some thoughts, or at least the info might be helpful.
Plugins installed (man I wish there was a command to list them):
BookWorm
CHAT_PROPER
DeathTpPlus
Maplicate
MinecartRevolution
MineralVein
ModifyWorld
[All NoLagg Modules]
PermissionsEx
QuickTree
SecretSwitch
StreamRemover
ThunderTower
TimeMaintain
VanishNoPacket
Vault
WaterproofRedstone
WirelessRedstone
XSigns
[EDIT]
I have run a timings command after many hours of running with high CPU. You can look at it here. It gave some interesting results that are different from NoLaggExamine. It appears that SnoGro is taking up quite a bit of that time, which possibly is making WR look like the cause due to some interaction with the way WR handles weather events along side other plugins. (I'm guessing that not all of these users are using SnoGro).
Any ideas on this?
@Sorky
Thanks for the report, that behavior is odd. I'm assuming you are using CB2126 and not Craftbukkit+ + with weather restrictions, correct?
@Tux
I am running v2.6.1 of WR on CB2126. I am also periodically experiencing the issue with CPU usage spiking and staying like that, effectively halting some other plugins, until i stop the server and start it back up again. I suspected AdminCmd as being resposible at first and Dark_Balor has been having me run timing checks with his plugin which shows some odd behaviour off WR. I guess i had better say sorry to him... but here is the log:
http://www.nub.nu/dumpfile2.log
Ofcourse, i dont KNOW that its WR either, but i see in your comments that other people are having the same issue.. which is atleast something.
@Tux2
Oh? Well crap. Either I am being completely daft or I have a bug then. I'm going to boot the plugin again and see if I still have issues with executing commands. I'll get back to ya with a ticket if I have problems.
Thanks, D.
@Digitalink2008
The development stage of WeatherRestrictions is at Mature, what that means is that I'm probably not going to change something unless bukkit changes something. This is working just fine in the 1.2.4 dev builds. Besides, what else could I add?
Just checkin in tux. You kill off development for weather restrictions?
Digi
@Tux2
I'll see when I can do that.
@Joymo
There was a major flaw found, and fixed. The before and after timings of the plugin were drastically different. Of course I run this plugin on my server as well and don't see anything in the timings file about it taking insane amounts of time for anything and I would need a timings file to see where their bottle neck was found.
I wouldn't say "no reason" seeing my bug report about this weeks ago. I know you made an update since then, but who says that's 100% fixed it, seeing you called it something like "performance improvements" while the issue was very extreme, and seemed like it would require a major flaw to be found...haven't tested new version yet though.
@uncovery
There should be no reason for this plugin to create a huge CPU load at any point in time. If you wouldn't mind enabling the timings mode in bukkit and get me an output of your timings.txt file for weather restrictions I would be more than happy to fix it.
I am running this on R4 and it creates HUGE processor load from time to time. I do not know why or how, but the moment I remove or unload the plugin the lag seems to be gone. I wonder if there is a debug to filter the issue down, but it forced me to uninstall it
nice one. A reload command would be great, too
@Digitalink2008
Bukkit has this implementation by default; type "/version WeatherRestrictions" to do so. The only caveat is the argument for the plugin name is case sensitive. If you don't know the name or case of a certain plugin for which you want to check the version, just type "/plugins".
@Tux2
If its a simple addition a command to readout the version would be helpful.
Thanks Tux. D.
@jayD101
This is now fixed in v2.6
@Digitalink2008
Yes, you will need to do a /reload command. I'll see about adding in a option in the next version to reload just the weather restrictions config files.