[ADMN/MISC] ButtonControl v3.0 - Control the weather/time with buttons [Vault] [1531]

Discussion in 'Inactive/Unsupported Plugins' started by Johni0702, May 27, 2011.

  1. Offline

    Johni0702

    ButtonControl
    v3.0
    BukkitDev (download here)



    As of the fact i recoded the whole datastructure of the plugin, all configfiles before 3.0 are NOT compatible with newer versions!


    A simple plugin to control the weather or time with buttons. Your servervisitors can switch the weather and time for free or for items (Vault economy is supported too). You can use Buttons or Pressure Plates. I´ll include new things too, simple write it in the comments.

    Features:
    • Control weather or time using buttons
    • Control weather or time can cost something
    • You can use (Stone) Pressure Plates too
    • All messages can be modified
    • Vault economy support
    • MultiWorld
    • BukkitPermissions support
    • Cooldown
    How to set buttons:

    The command depends on wheather Vault is installed or not.
    With Vault (open)

    1.type (buttoncontrol.set Permission needed)
    "/buttoncontrol <sunny/rain/thunder/day/night> <Money> <Receiver>"
    or
    "/bc <sunny/rain/thunder/day/night> <Money> <Receiver>"

    <Receiver> is the person who gets the money whenever some uses the button/pressureplate

    Without Vault (open)


    1.type (buttoncontrol.set Permission needed)
    "/buttoncontrol [sunny/rain/thunder/day/night] <amount> <item>"
    or
    "/bc [sunny/rain/thunder/day/night] <amount> <item>"


    2.You´ll get a message "Press a button!"
    3.Do what the message says.
    Press the button/pressure plate which should become the rain/thunder/stop/day/night button.
    4.If you get an other message, the creation was succesfull

    How to remove buttons:
    Destroy them ingame and they´r gone. (if you have permission to do so)

    How to use buttons:
    1(only without Vault).Take the required items in your inventory.
    2.Click the button./Walk on the pressure plate.
    3.You get a message and your "money" was take away
    4.Look at the sky -> the weather/time changed

    Permissions:
    To set Buttons: buttoncontrol.set
    To destroy Buttons : buttoncontrol.destroy
    To use buttons:
    -day: buttoncontrol.time.day
    -night: buttoncontrol.time.night
    -sunny: buttoncontrol.weather.sunny
    -rain: buttoncontrol.weather.rain
    -thunder: buttoncontrol.weather.thunder

    Configuration:
    Default conig file:
    Code:
    Cooldown: 0 //time in sec you have to wait befor an button can be pressed again
    Buttons: []          //DO NOT CHANGE ANYTHING HERE (exept you know what you do)
    Duration:              //how long the changed weather MUST be in secounds(if not changed again)
        thunder: 10
        rain: 10
        sun: 10
    messages:  //a lot of configurable messages
        ...
        ...
    
    Github

    Todo:
    • Add iConomy support(Vault)
    • Add permissions support
    • Add Essentials support(Vault)
    • Add MultiWorld support
    • Search bugs
    • Fix bugs
    • Add BOSEconomy support(Vault)
    • You can set the money for every button different
    • add an account that earns money when a player pushs an button
    • add an cooldown
    Changelog:

    v 3.0:
    • Recoded the inner data structure of the plugin
    • Updated to new Listener API
    • Updated to BukkitPermissions
    • Added Vault support instead of only iConomy
    v 2.3:
    • Added an Cooldown
    • Added an account that earns money if an player pushs an button
    • fixed "No Permissions" message
    Older Changes (open)

    v 2.2:
    • Addded Permissions support (thx to flames)
    • Fixed: If a button is free , now you can hold anything in your hand
    • Fixed: All the time MultiWorld didn´t work
    v 2.1.1:
    • Fixed Bug: iConomy takes one prize even if the buttons have all different
    v 2.1:
    • All buttons can cost different
    v 2.0:
    • Renamed the plugin from "ButtonWeather" to "ButtonControl"
    • Added: control time by buttons/pressure plates
    • fixed one very little bug
    v 1.5.2:
    • fixed bug again: changed messages didn´t load from the config
    v 1.5.1:
    • fixed bug: changed messages didn´t load from the config
    v 1.5:
    • fixed bug: if you hold the exact amount of money it won´t disapear
    • added Pressure Plates support
    • fixed bug: if you break an button and anyone (without he´s OP) place it again, the button works
    v 1.4:
    • all messages can be changed in the config now
    v 1.3:
    • now you haven´t to take the EXACT amount of money in your hand
    v 1.2.3:
    • fixed error if klick in the air
    v 1.2.2:
    • fixed an bug in the savesystem that saved the count of the stop/thunder buttons wrong
    v 1.2.1:
    • fixed an bug on the stormbutton
    • fixed an bug in the savesystem
    v 1.2:
    • added MultiWorld support
    • fix a lot of bugs
    • now unlimited buttons can be set
    • changed weather is now longer (configurable)
    v 1.1:
    • added iConomy support
    v 1.0:
    • Main plugin
     
    nicoxxl, vrox and Lolmewn like this.
  2. You should clean it up a bit (config file in code/quote tags)
    also you are missing the changelog and the download link (rather no attached files, guests can't download them)

    other then that, nice idea :) (didn't test plugin)
     
  3. Offline

    Lolmewn

    Cool <3
    Like!

    oh by the way it's disappears, not what you have in your post ;)

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: May 16, 2016
  4. your download "link" disappeard
     
  5. Offline

    Johni0702

    oh sorry. i fix this. now it´s back
     
  6. put your changelog into a spoiler. [ spoiler ]
     
  7. Offline

    speeddemon92

    The latest 2 version changes are required to be outside a spoiler according to one of the Mods here.


    @Johni0702 A suggestion would be to allow users to choose a world statically like in your config or dynamically ingame where the world in which the buttons exist becomes the world it controls the weather for
     
  8. Offline

    vrox

    Thanks! Ill try this out as soon as I get a chance!
     
  9. hm get this error after pushing a button

    Show Spoiler

    2011-05-27 23:12:06 [SEVERE] Could not pass event PLAYER_INTERACT to ButtonWeather
    java.lang.NullPointerException
    at me.johni.ButtonWeather.ButtonWeatherPlayerListener.onPlayerInteract(ButtonWeatherPlayerListener.java:81)
    at org.bukkit.plugin.java.JavaPluginLoader$9.execute(JavaPluginLoader.java:299)
    at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:58)
    at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:310)
    at org.bukkit.craftbukkit.event.CraftEventFactory.callPlayerInteractEvent(CraftEventFactory.java:162)
    at org.bukkit.craftbukkit.event.CraftEventFactory.callPlayerInteractEvent(CraftEventFactory.java:133)
    at net.minecraft.server.NetServerHandler.a(NetServerHandler.java:771)
    at net.minecraft.server.Packet18ArmAnimation.a(SourceFile:35)
    at net.minecraft.server.NetworkManager.a(NetworkManager.java:196)
    at net.minecraft.server.NetServerHandler.a(NetServerHandler.java:75)
    at net.minecraft.server.NetworkListenThread.a(SourceFile:100)
    at net.minecraft.server.MinecraftServer.h(MinecraftServer.java:377)
    at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:292)
    at net.minecraft.server.ThreadServerApplication.run(SourceFile:394)

    Show Spoiler
     
  10. Offline

    vrox

    Tried it, and it usually works well. It took me a while to realize I had to hold the exact amount of redstone. I kept using a full stack and expecting it to remove 5. But after I realized that, it usually worked fine. I got the same message as Darkride a few times when using the Stop button, but I moved the buttons from my test area to where I want them to really be and haven't gotten that message. Not sure why.
    Other then that, it works perfectly! Just what I wanted!

    EDIT:
    Tested some more, and Im getting that same error message Darkride got quite a bit, though it seems to be working fine.
    One request though, could you make the weather stay for a bit longer? About an in game day or so before the game takes control of the weather again? I find that sometimes I use it to clear the rain, and about five minutes later it will start raining again. Thanks.
     
  11. Offline

    Johni0702

    I can´t say you why this error happens, because I´m already working on a new version (MulitWorld compatible) with a new save system. One Question: Do you use iConomy and set iConomy.useiConomy in the Config to true?
     
  12. i have iConomy but i dont want to use it for this plugin


    Edit:

    maybe timecontrol ?
     
  13. Offline

    Johni0702

    sorry i cant say you why there is an error but in the next 6 hours i will release 1.2 with MultiWorld support. With this update this error should be fixed. i only have to test the version than i´ll release it.

    Now it should be better. Version 1.2 released.

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

    vrox

    Is the duration in minutes? Or in game hours?
     
  15. Offline

    Johni0702

    oh i forgett to write it in the config file: it´s in real minutes
     
  16. Offline

    vrox

    The storm button seems bugged. Whenever I make one, it doesnt give the message saying "the storm button has been created" and when I look in the config, it has weird settings compared to the others:
    Show Spoiler

    Storm:
    Y:
    '0': 119
    '2': 119
    X:
    '0': -81
    '1': 0
    '2': -81
    world:
    '0': Civilization
    '2': Civilization
    Z:
    '0': -163
    '2': -167


    Also, I still keep getting this error when I press any button, and often at seemingly random times:
    Show Spoiler

    2011-05-28 21:21:36 [SEVERE] Could not pass event PLAYER_INTERACT to ButtonWeather
    java.lang.NullPointerException
    at org.bukkit.craftbukkit.CraftServer.getWorld(CraftServer.java:410)
    at me.johni.ButtonWeather.ButtonWeather.loadFile(ButtonWeather.java:131)
    at me.johni.ButtonWeather.ButtonWeatherPlayerListener.onPlayerInteract(ButtonWeatherPlayerListener.java:152)
    at org.bukkit.plugin.java.JavaPluginLoader$9.execute(JavaPluginLoader.java:299)
    at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:58)
    at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:310)
    at org.bukkit.craftbukkit.event.CraftEventFactory.callPlayerInteractEvent(CraftEventFactory.java:162)
    at net.minecraft.server.ItemInWorldManager.dig(ItemInWorldManager.java:64)
    at net.minecraft.server.NetServerHandler.a(NetServerHandler.java:443)
    at net.minecraft.server.Packet14BlockDig.a(SourceFile:42)
    at net.minecraft.server.NetworkManager.a(NetworkManager.java:196)
    at net.minecraft.server.NetServerHandler.a(NetServerHandler.java:75)
    at net.minecraft.server.NetworkListenThread.a(SourceFile:100)
    at net.minecraft.server.MinecraftServer.h(MinecraftServer.java:377)
    at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:292)
    at net.minecraft.server.ThreadServerApplication.run(SourceFile:394)

    The error doesnt seem to stop it from working, but it spams up the console.
     
  17. Offline

    Johni0702

    can you give me your complete config file please. I think i know why there is this error.

    EDIT: Error has been fixed -> read below

    Bug is fixed. To correct your config change it to these:
    Show Spoiler

    //all is the same except:
    Storm:
    Y:
    '0': 119
    '2': 119 //change '2' to '1'
    X:
    '0': -81
    '1': 0 //delete this row
    '2': -81 //change '2' to '1'
    world:
    '0': Civilization
    '2': Civilization //change '2' to '1'
    Z:
    '0': -163
    '2': -167 //change '2' to '1'
    //somewhere else:
    button:
    stormAnzahl=2


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

    rano1234

    i have cb815 but it still gives this error
    Code:
    11:23:44 [SEVERE] Error occurred while enabling ButtonWeather v1.2.1 (Is it up to date?): null
    java.lang.NullPointerException
        at org.bukkit.craftbukkit.CraftServer.getWorld(CraftServer.java:414)
        at me.johni.ButtonWeather.ButtonWeather.loadFile(ButtonWeather.java:131)
        at me.johni.ButtonWeather.ButtonWeather.onEnable(ButtonWeather.java:78)
        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:134)
        at org.bukkit.craftbukkit.CraftServer.loadPlugins(CraftServer.java:112)
        at org.bukkit.craftbukkit.CraftServer.reload(CraftServer.java:339)
        at org.bukkit.command.SimpleCommandMap$ReloadCommand.execute(SimpleCommandMap.java:247)
        at org.bukkit.command.SimpleCommandMap.dispatch(SimpleCommandMap.java:128)
        at org.bukkit.craftbukkit.CraftServer.dispatchCommand(CraftServer.java:273)
        at net.minecraft.server.MinecraftServer.b(MinecraftServer.java:425)
        at net.minecraft.server.MinecraftServer.h(MinecraftServer.java:410)
        at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:308)
        at net.minecraft.server.ThreadServerApplication.run(SourceFile:422)
    
    can this be fixed?
    thanks in advance Rano Veder

    Can you make the same plugin but then with time. that people can control time by clicking buttons?

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

    Johni0702

    I´ll make it. But can take some time. (3 to 5 days)
     
  20. Offline

    rano1234

    ok johni. thank you
     
  21. Offline

    Johni0702

    I don´t know sure because on my server there isn´t this error. if you delete the config file and restart the server it could work. according to the error something went wrong while loading the world. that could be because a changes in the config file. before deleting it please post it here (so I could fix this error).
     
  22. Offline

    rano1234

    oke here is the config
    Code:
    Cost:
        Amount: 3
        Item: 256
    Buttons:
        StormAnzahl: 3
        RainAnzahl: 2
        StopAnzahl: 1
        Stop:
            Y:
                '0': 74
                '1': 74
            X:
                '0': -106
                '1': -106
            world:
                '0': world
                '1': world
            Z:
                '0': 115
                '1': 116
        Rain:
            Y:
                '0': 74
                '1': 74
            X:
                '0': -109
                '1': -108
            world:
                '0': world
                '1': world
            Z:
                '0': 103
                '1': 103
        Storm:
            Y:
                '0': 74
                '3': 56
            X:
                '0': -108
                '1': 0
                '3': 127
            world:
                '0': world
                '3': world
            Z:
                '0': 127
                '3': -40
    Duration:
        thunder: 10
        rain: 10
        sun: 10
    iConomy:
        useiConomy: false
        money: 0
    thanks for all your help.
     
  23. Offline

    Johni0702

    it´s like i thought. i´ll fix this error when i´ve time (not now maybe in two hours).if you delete your config it can work.
     
  24. Offline

    rano1234

    johni, you are awesome. it works now. thanks for your help.
     
  25. Offline

    Johni0702

    one last question that helps me to find the bug: did you use v1.2 before?
     
  26. Offline

    rano1234

    yes. i used 1.2 before
     
  27. Offline

    Johni0702

    ok than i know: it´s a bug in the savesystem of 1.2 and in 1.2.1 it causes errors the only thing to do is to delete the config and restart the server.
     
  28. Offline

    rano1234

    i think it are the storm buttons causing the errors, because everything worked fine until i set the storm button. then the null error showed up.
     
  29. Offline

    vrox

    I still keep getting this error constantly, even when I'm off building, not doing anything with the plugin.
    Show Spoiler

    2011-05-27 19:16:30 [SEVERE] Could not pass event PLAYER_INTERACT to ButtonWeather
    java.lang.NullPointerException
    at me.johni.ButtonWeather.ButtonWeatherPlayerListener.onPlayerInteract(ButtonWeatherPlayerListener.java:81)
    at org.bukkit.plugin.java.JavaPluginLoader$9.execute(JavaPluginLoader.java:299)
    at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:58)
    at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:310)
    at org.bukkit.craftbukkit.event.CraftEventFactory.callPlayerInteractEvent(CraftEventFactory.java:162)
    at org.bukkit.craftbukkit.event.CraftEventFactory.callPlayerInteractEvent(CraftEventFactory.java:133)
    at net.minecraft.server.NetServerHandler.a(NetServerHandler.java:771)
    at net.minecraft.server.Packet18ArmAnimation.a(SourceFile:35)
    at net.minecraft.server.NetworkManager.a(NetworkManager.java:196)
    at net.minecraft.server.NetServerHandler.a(NetServerHandler.java:75)
    at net.minecraft.server.NetworkListenThread.a(SourceFile:100)
    at net.minecraft.server.MinecraftServer.h(MinecraftServer.java:377)
    at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:292)
    at net.minecraft.server.ThreadServerApplication.run(SourceFile:394)

    And the the weather doesn't last as long as I set it for. Maybe its related?
     
  30. Offline

    rano1234

    yeah me too. but johni it fixing it so be happy. wooooh
     

Share This Page