[FUN/MECH] WeatherRestrictions v2.2 - Control the Frequency of Weather [1317,1337,1.0.1-R1]

Discussion in 'Inactive/Unsupported Plugins' started by Tux2, May 11, 2011.

  1. WeatherRestrictions - Control the Frequency of Weather:
    Version: v2.2


    This is a fork of the NoWeather Plugin with some changes so that you can change the frequency and the minimum delay between storms. 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.
    To configure it see the config options spoiler below.
    Note: This plugin has been completed and is now in maintenance mode. No new features will be added (except for new permissions support) unless frequently requested.

    Features:
    • Can totally stop weather
    • Toggles different aspects of the weather.
    • An option to stop snow 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 (Including Bukkit Permissions) support
    • Configurable chance (disabled by default) Supercharged lightning strikes that will blow a hole in the ground.
    • Configurable explosion radius
    • Integrates with ThunderTower(optional, need to download ThunderTower if you want it to work) to prevent you from blowing your ThunderTowers up with supercharged strikes.
    Download WeatherRestrictions.jar v2.2
    Download WeatherRestrictions.jar v2.1
    Download WeatherRestrictions.jar v2.0 - For Bukkit version 1185
    Download WeatherRestrictions.jar v1.9 - For Bukkit version 1000-1060
    Download WeatherRestrictions.jar v1.8 - For Bukkit version 893-953
    Download WeatherRestrictions.jar v1.7 - For Bukkit version 860
    Download WeatherRestrictions.jar v1.1 - For Bukkit version 740
    Source Code

    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.
    Permissions:
    (If you are using 1.9 or below use RandomWeather instead of weatherRestrictions)
    • 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
    Config File Options:
    Config File Options (open)

    disable-snow-accumulation - if set to true will disable all snow accumulation in that world
    disable-ice-accumulation - if set to true will disable all ice accumulation in that world
    disable-lightning - if set to true it will disable all lightning strikes in that world
    disable-thunder - disables thunder storms in the world
    disable-weather - disables all rain/snow in a world
    supercharged-thunder-chance - Set the percentage chance that a supercharged thunderbolt will blow a hole in the ground.
    max-rain-wait - Maximum time to wait between rain storms in seconds. -1 Disables it
    supercharged-explosion-radius - Set the radius of the supercharged explosion
    thunderstorm-chance - The percentage chance that a rain storm is going to be a thunderstorm
    minimum-rain-wait - Minimum amount of time in seconds between storms
    max-rain-duration - Maximum amount of time in seconds it can rain/snow for. Set to -1 to disable this option.


    Plugin Not working correctly?
    For me to diagnose the issue properly please provide me with the following information:
    Code:
    Description of issue:
     Version of Craftbukkit:
     Version of java:
     OS:
     Other plugins installed:
    Output of console (If there are any error messages):
     WeatherRestrictions configuration file:
    
    Changelog:
    Version 2.2
    • Fixed ConcurrentModificationException bug.
    • General code cleanup.
    Version 2.1
    • Changed YML config to use new bukkit system.
    • Changed the makeall-thunderstorms to a thunder-chance variable.
    Version 2.0
    • Added Bukkit SuperPerms support
    • Added Support for the newest dev version of ThunderTower in using the new API. (1.3.1beta)
    • Changed permission nodes to match official name
    Complete Changelog (open)

    Version 1.9
    • Removed depreciated hook SNOW_FORM. Using BLOCK_FORM now.
    Version 1.8
    • Added ice prevention option.
    • Recoded weather start/stop to be thread safe.
    Version 1.7
    • Fixed a bug where supercharged lightning would not work if ThunderTower was not installed.
    Version 1.6
    • Changed default option for max-rain-wait to -1
    • Added more thread synchronization.
    Version 1.5
    • Essentials compatibility without a separate download
    • Created the command /wr and made all the other commands aliases. It now just throw an informational message up if it can't enable the shorthand commands.
    • Added the options max-rain-wait and max-rain-duration. They can be disabled by putting them at -1
    Version 1.4.1
    • Removed Stray debug text
    Version 1.4
    • Added supercharged lightning
    • Added /lightning command
    • Added ThunderTower support
    Version 1.3
    • Added the option to make all storms thunder storms
    Version 1.2
    • Added the option to disable snow accumulation
    Version 1.1
    • Added messages to let you know why /rain or /thunder didn't work in a world. (Disabled, or not enough time elapsed between storms, etc.)
    • Minor improvements
    Version 1.0
    • Added Permissions support (optional, defaults to OPs only if not present)
    • Added commands /thunder and /weatherstats
    • Added command alias /clearrain
    • Removed Debug messages
    Version 0.9.1-beta
    • Changed name to WeatherRestrictions.
    • Fixed a bug where it would never rain.
    • Added more debug lines.
    • Added the commands /rain [world] and /rainclear [world] for testing purposes. (Commands only available for OPs.) Also, the commands respect the minimum delay, and other settings of the world.
    Version 0.9-beta
    • Added the somewhat random weather.


     
  2. Offline

    Sphax

  3. At the moment? no. Can I add it? Definitely! It will take a few code changes but it is a cool idea. Right now I just have it listening to when the server wants to rain/snow and deny/allow it based on how much time has elapsed. So, yeah, I'll see about adding an option to increase/decrease the amount of thunderstorms. (I'm still new to the weather stuff in bukkit so it might take a day or two)
     
    Sphax likes this.
  4. Offline

    QQCucumber

    Does RandomWeather have the same problem NoWeather does handling disabling weather in some worlds and not others, detailed here?

    http://forums.bukkit.org/threads/me...ble-weather-thunder-globally-740.14600/page-2
     
  5. I would assume so. Thanks for pointing that out.;) I think it is because of the way bukkit passes the rainstorm even to the plugin, so I'll get on that and see if I can squash that bug on my fork.
     
  6. Offline

    QQCucumber

    Thank you. Also, when you do implement max-rain-wait, can -1 be 'no maximum'? tia
     
  7. Offline

    Sphax

    Great !
    So I re-post here my ideas about weather.

    I would be able to :
    - Set the "world" world as default (the plugin would not change anything in this world)
    - Set another world to have 50% chances (more or less) to have a thunderstorm world-wide and biome independently
    - Set the thunderstorm without rain/snow (don't know if possible)
    - Have some extra big thunder bolts (with chance parameter) with explosions and fire spreading on grass and trees. This extra powered thunder bolt would instantly change in a range (if not destroyed) the grass in dirt (or other blockID), leaves in charcoal (destroyed block), trunks in netherhack (or other blockID) and rock/cobblestone in coal blocks (or other blockID)
    - The thunder would strike iron blocks if some are near and would electrify the striked iron block (without destroying them). That would prevent fire and explosion but would ignite any entities that would be too near them.
     
  8. Offline

    QQCucumber

    @Tux2: I went ahead and tried it out and it seems like it has the opposite problem that NoWeather has. Even though my default world 'world' is supposed to have weather enabled, the console proudly proclaims 'Stopped weather!' when a storm would otherwise happen on world.

    By the way, think there could be an option to disable the Stopped weather! debug message? It's nice, but once it's working properly, I'd like to be able to turn it off to trim down on console spam.
     
  9. Lol! It must have gotten the event from another world first. I'll be rewriting my code so that it handles those events properly. Also, the debug messages will go away once I know that it is sensing weather starts and stops correctly (The main reason why I posted it so soon was to get feedback on that. I am trying to debug it, I just can't wait all day waiting for storms to come along...).
     
  10. Offline

    QQCucumber

    By the way, RandomWeather is kind of a misleading name in relation to what the plugin actually does. May I suggest WeatherRestrictions?
     
    Tux2 likes this.
  11. Love it! I'll change the name on the next update (I have to edit some of the code to reflect the new name).
     
  12. Heh thats what you forked my plugin for :)
     
  13. Hey guys, just wanted to update you on the status of the plugin. I've been putting in more debug messages in the code that are also more descriptive. Once I do some internal testing I'll be posting another test release so that you guys can make sure it is working properly. One of the things I have added is in what world it is supposedly stopping the weather in. I expect to have one for you to test in another day or so.
     
  14. Offline

    tassox33

    Cool, yah i think the name would be better also. Is there a way to make it only lightning and thunder when theres rain? I don't want any mild rain storms.
     
  15. It's in the todo list once it's stable. :)

    Hey everyone, I did some more testing and it seems that there is a bug in bukkit as far as weather goes, where you either get rain/snow in all the worlds, or none at all. See issue here: http://leaky.bukkit.org/issues/705

    So, as far as the plugin goes, I'm going to go forward and program it like that issue has been fixed, but until then only the main world configuration will be used.

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: Jul 16, 2016
  16. Offline

    Sphax

    Maybe that's why I get some snow on the ground where it shouldn't be ?
     
  17. Offline

    EmanuxJade

    don't work for me on 760 and iConomy 5..no more rain after install this plugin o.o...why?
     
  18. Offline

    tassox33

    Emanux look at the text file thats included. It turns off rain by default.
     
  19. Hey guys, I just released an updated version of the plugin. I found some pretty bad bugs that I fixed, and I think it is stable, I just need you guys to test it out for a bit. Once it's verified working correctly I'll remove all the debug code and bump the version number to 1.0! Oh, and just so you know, permissions support will be forthcoming, I just wanted a way to test a few things with the plugin, that's why I added the commands (which are only available to OPs by the way).
     
  20. Well, I've been busy... I added permissions support (optional), more commands, and deemed it stable! So, here goes for version 1.0!
     
  21. Offline

    Joy

    Request: wget-download.

    Thanks for the plugin!
     
  22. Added! (although the other download link once you get to the other page does work with wget, you just have to re-name it....)

    This idea has now been implemented as an option in version 1.3.

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: Jul 16, 2016
  23. Well, version 1.4 has extra big thunder bolts that will cause explosions. Still working on the fire and changing the other surrounding blocks. Also, instead of re-implementing the iron block thing, I interfaced it with ThunderTower. Also, below is the result of a stray thunderbolt (I had the radius set on 10...):
    [​IMG]
     
  24. Offline

    TC.Barky

    Haven't tried this plugin out yet, but it looks perfect for what we need on my server. Just one question because I'm lazy and can't be bothered testing.... is there a conflict with essentials and its built in weather controls (as shite as they are :p)

    Just to let you know as well, if you use wget -O you can name things before they are downloaded. That way you do not have to rename files post-download.

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: Jul 16, 2016
  25. Offline

    Sixael

    on 803:
    Code:
    Error occurred while enabling WeatherRestrictions v1.4.1 (Is it up to date?): null
    java.lang.NullPointerException
            at de.crannk.xPaw.RandomWeather.onEnable(RandomWeather.java:86)
            at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:125)
            at org.bukkit.plugin.java.JavaPluginLoader.enablePlugin(JavaPluginLoader.java:750)
            at org.bukkit.plugin.SimplePluginManager.enablePlugin(SimplePluginManager.java:253)
            at org.bukkit.craftbukkit.CraftServer.loadPlugin(CraftServer.java:132)
            at org.bukkit.craftbukkit.CraftServer.loadPlugins(CraftServer.java:110)
            at net.minecraft.server.MinecraftServer.e(MinecraftServer.java:218)
            at net.minecraft.server.MinecraftServer.a(MinecraftServer.java:205)
            at net.minecraft.server.MinecraftServer.init(MinecraftServer.java:145)
            at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:265)
            at net.minecraft.server.ThreadServerApplication.run(SourceFile:394)
     
  26. Hmm... Very interesting... It's either you got a corrupted download, or something is interfering with the "thunder" command. I just downloaded my own plugin from the link above and I am not getting any errors... The file size should be 12.7KB. If redownloading it does not solve it would you mind listing everything below for me:
    OS:
    Java version:
    Craftbukkit build: (I'm assuming you have 803)
    Other Plugins you are using:
    Copy of your WeatherRestriction's config.yml file:
     
  27. Offline

    Sixael

    I downloaded it again to look whether it is because of a corrupted file or not, no change.
    OS and Java version: Can't say yet, would've to ask my host first.
    Craftbukkit build: 803
    Other Plugins:
    TrainYourLung, Stackable, SpyerAdmin, Permissions, MultiVerse, MobBounty, Minecart Mania (all except Autocart), MidiBanks, LightVote, LightLevel, itemkill, InstaBreak, iConomy, HeroicDeath, gravelclay, Flowcontrol, FenceStack, FalseBook (all except cart), Essentials.
    WeatherResctriction file:
     
  28. It Wasn't essentials compatible, I now have an essentials compatible version above. The essentials version has /rwthunder and /rwlightning for the moment as it seems essentials wants the /thunder and /lightning commands. Once I have more time I'll put in an option in the config for essentials compatibility.
     
  29. Offline

    Sixael

    nice, thanks a lot.
     
  30. Offline

    TC.Barky

    Thank you very much for your prompt response! Very impressed.
     

Share This Page