[GEN/MECH] Cooldowns v1.1 - Configurable Cooldowns and Warmups [1060]

Discussion in 'Inactive/Unsupported Plugins' started by krinsdeath, Jul 4, 2011.

  1. Offline

    krinsdeath

    Cooldowns v1.0.0 - Configurable command cooldowns and warmups​
    Wiki
    Version 1.1 is now released!
    The plugin has gone through an insane amount of revision. I honestly didn't think the project would grow to be this large, or this complicated, but there you go. The new feature list is astounding by comparison. Version 1.0.0 requires CraftBukkit 1000, and I recommend PermissionsBukkit for managing the groups.​

    In version 1.1, the config.yml has added the key "priority" to the groups nodes. As a result, you can either delete your current configurations to get the new nodes, or edit them by hand (their location is provided in the default config.yml farther down this post). The priority node will determine which group a user ends up in if more than one group is detected by the plugin (due to inheritance or whatever reason). This node is optional, but recommended. The higher a group's priority, the more likely the user is to be set to that group. Furthermore, the plugin now checks the player's group every time they log in or the plugins are reloaded.​
    In addition to the priority node, the plugin now checks for groups at "cooldowns.[groupname]" and "group.[groupname]"​
    If you have multiple plugins which use the latter format, this plugin will duplicate their functionality (provided your groups in config.yml are the same name), in an effort to reduce node clutter.​

    Requirements
    • CraftBukkit build 1000 (or later)
    Optional (Recommended)
    • PermissionsBukkit 1.2 (or later)
    Want me to include your language? Send me a language.yml with (at the very least) localization information for all of the default messages, and I'll package it into the jar!

    Originally requested by @GFlow in this thread

    For more verbose installation/usage instructions, visit the wiki.

    Description: Configurable command cooldowns and warmups, based on 'groups'.

    Basic Usage: Drop Cooldowns.jar into your plugin directory, and go!
    config.yml (open)

    Code:
    plugin:
        # put the worlds you want to manage cooldowns and warmups in here
        worlds:
          - 'world'
          - 'world_nether'
        default_locale: 'en_US'
        available_locales: [en_US]
        # colors: true will enable logging in color (this will only work on non-windows platforms)
        colors: true
    
    groups:
        # -----------------
        default:
            priority: 1
            # prefix applies to messages sent by this plugin to the player, such as status messages
            # it does not change chat settings, and should not interfere with any other plugins
            prefix: '[default] '
            interrupts:
                movement: true
                damage: true
                command: true
            globals:
                cooldowns: true
                warmups: true
            # _all_ will match all commands (for a root node), or all arguments for a sub-node
            # _self_ will match the command sender's name
            # all values specified are in seconds.
            commands:
                warmup:
                    _all_: 5
                cooldown:
                    _all_: 5
        # -----------------
        user:
            priority: 2
            prefix: '[user] '
            interrupts:
                movement: true
                damage: true
                command: true
            globals:
                cooldowns: true
                warmups: true
            commands:
                warmup:
                    home: 2
                    warp:
                        home: 2
                        _all_: 5
                cooldown:
                    home: 60
                    warp:
                        home: 60
                        _all_: 120
        # -----------------
        admin:
            priority: 3
            prefix: '[admin] '
            interrupts:
                movement: false
                damage: false
                command: true
            globals:
                cooldowns: true
                warmups: true
            commands:
                warmup:
                    kill: 2
                    tp:
                        _self_: 2
                        _all_: 2
                    time: 2
                cooldown:
                    kill: 5
                    tp:
                        _self_: 60
                        _all_: 120
                    time: 5
    

    Localization (open)

    Code:
    # set any value to "null" to disable it entirely.
    plugin:
        enabled: "Enabled."
        disabled: "Disabled."
        language: "American English"
        locale_not_found: "No such locale exists."
        locale_changed: "Language changed to American English."
        help:
          - '&b/<cmd> help &f- &aDisplays this help menu.'
          - '&b/<cmd> loc [option] &f- &aSets your locale to'
          - '--- &athe option provided, or lists available locales.'
          - '&b/<cmd> setup &f- &aShows your settings.'
          - '&b/<cmd> &f- &aLists your current cooldowns.'
        setup:
          - 'Your settings: (American English)'
          - '&aGlobals&f:'
          - '-- Warmups... &a<global_warm>'
          - '-- Cooldowns... &a<global_cool>'
          - '&aInterrupts&f:'
          - '-- Movement... &a<movement>'
          - '-- Commands... &a<commands>'
          - '-- Damage... &a<damage> &f(&cnot implemented&f)'
    
    # set any _generic_ key to null to disable it
    # ------- #
    # warmups #
    # ------- #
    warmup:
        start:
            _generic_: "'&b<cmd>&f' is now warming up. (&b<wu>&f)"
        status:
            _generic_: "'&b<cmd>&f' is warming up. (&b<wu>&f)"
        done:
            _generic_: "You are no longer warming up '&b<cmd>&f'."
        cancel:
            _generic_: "&cYou cancelled '&3<cmd>&c'..."
            _movement_: "&cYou moved and cancelled '&3<cmd>&c'..."
            _damage_: "&cYou took damage, which cancelled '&3<cmd>&c'..."
    
    # --------- #
    # cooldowns #
    # --------- #
    cooldown:
        start:
            _generic_: null
            # "'&b<cmd>&f' is now cooling down. (&b<cd>&f)"
        status:
            _generic_: "'&b<cmd>&f' is cooling down. (&b<cd>&f)"
        done:
            _generic_: "You are ready to use '&b<cmd>&f' again."
    

    Permissions (open)

    Permissions flags are equivalent to the group names you set in the config.yml, plus the "cooldowns." prefix. By default, the permissions are as follows:
    cooldowns.default - Applies the configuration settings for the default group.
    cooldowns.users - Applies the configuration settings for the users group.
    cooldowns.admins - Applies the configuration settings for the admins group.

    Furthermore, if you use PermissionsBukkit and rely on inheritance, you'll need to cancel the previous group's permission:
    Code:
    groups:
        default:
            permissions:
                cooldowns.default: true
        user:
            permissions:
                cooldowns.users: true
                cooldowns.default: false
            inheritance:
            - default
        admin:
            permissions:
                cooldowns.admins: true
                cooldowns.users: false
            inheritance:
            - user
    

    Screenshots (open)

    [​IMG]
    [​IMG]

    Commands:
    • /cooldowns - Without any parameters will print a list of currently cooling commands.
    • /cooldowns locale [option] - The option flag will attempt to set that user's locale to the option he provides. If no option is provided, it will print a list of localizations available.
    • /cooldowns setup - Show the settings for the user who sends the command
    • /cooldowns help - Prints a brief help message detailing the above information.
    • /cd and /cooldown are both aliases for /cooldowns, and will work interchangeably.
    Features:
    • Completely configurable warmups, including being able to cancel commands by taking damage, moving, or issuing another command.
    • Configurable cooldowns, including global and local cooldowns, that persist across server restarts and reloads.
    • Localizations, including options inside the localization to configure messages for commands my plugin doesn't know about.
    Issues: v1.0.0 is newly released. I haven't yet found bugs.
    Feedback and error reports are very helpful. Be thorough when you tell me what's wrong! This includes your server.log, lists of plugins (and their versions), which build of craftbukkit you are running, any modifications you've made to the configuration, plus any other information you feel is relevant. More information = faster bug fixes!

    Changelog:
    Version 1.0.0:
    • Complete rework of the project, from the ground up
    • Includes both local and global warmups and cooldowns
    • More configuration, more stability, more power
    • Verbose localizations, including custom status messages per command
    Version 0.5.0:
    • Massive restructuring of the plugin, which included moving it to Maven.
    • The configuration file has dropped in complexity, yet offers most of the same functionality.
    • Local cooldowns are simply not realistic. As such, I've made commands local in the sense that only commands listed for the user in my configuration will be cooled or warmed.
    • All cooldowns are global. If a command has a 10 second cooldown, all commands [registered to my plugin] are unusable for 10 seconds.
    • Removed the ability to cancel warmups by moving. If I find some way to easily configure options for this, I'll add it back in.
    Changelog (~0.4.0a) (open)

    Version 0.4.0a:
    • Localizations for every conceivable command variation
    • Warm ups and cooldowns can be interrupted by damage, and can work on different timers
    • Won't claim anything outlandish like it's stable, as this is a massive amount of work and I can't really test it all on my own.
    • Hopefully you're satisfied!
    Version 0.3.0a:
    • Restructured plugin
    • Added command (/cooldowns)
    • Increased localization
    • Warmups and cast times are even more configurable(?)
    Version 0.2.2:
    • Added warm up periods
    • General cleanup
    • New class to parse messages contained in locale files
    • TODO
      1. Warm up reset on player damage
      2. Warm up reset when player types a new command
    Version 0.2.1:
    • Added Localizations
    • Fixed cooldown messages
    • Added users.yml for persistent localization per user
    • TODO
      1. Hook permissions for localizations?
      2. Warm up/cast times for commands
      3. Configurable warm up/cast times on player damage
    Version 0.2.0:
    • Added Block cooldowns
    • Changed config format
    • More comments
    Version 0.1.0:
    • Initial release
     
    Taranis01 likes this.
  2. Offline

    krinsdeath

    @Monkz - Exactly. It might work without doing that, except that you can't be 100% certain which group my plugin will find first (it writes the player's group upon finding the first node that the player has permission to access, and then exits (or sets their group to default))
     
  3. Offline

    Qiadda

    it is possible to block?

    / spawn, / Spawn / sPawn, / spAwn, etc...

    thank :)
     
  4. Offline

    krinsdeath

    @Qiadda - I really have no idea what you mean. The commands entered by players should be case-insensitive, so long as you configure the plugin with all lowercase values.
     
  5. Offline

    Boos

    Why no message is shown, when warmup starts, even when it is turned on in config?
    Same thing with cooldown.
     
  6. Offline

    krinsdeath

    What? A warmup message should show up if you start one, and in order for a command to say "blah is now cooling down" you need to configure it in the localization file. By default I set cooldown.start._generic_ to null to prevent too much spamming.
     
  7. Offline

    Monkz

    Permissions dont work. I use PermissionsEX 1.13 and i do the format i showd u before, and just wont work. Everyone is stuck as default.
     
  8. Offline

    Boos

    I know, but when i use command, nothing is shown. Only message that "you are no longer warming up...". Where is the problem?
    Show Spoiler

    Code:
    My language file:
    
    plugin:
    
    enabled: "Enabled."
    
    disabled: "Disabled."
    
    language: "American English"
    
    locale_not_found: "No such locale exists."
    
    locale_changed: "Language changed to American English."
    
    help:
    
    - '&b/<cmd> help &f- &aDisplays this help menu.'
    
    - '&b/<cmd> loc [option] &f- &aSets your locale to'
    
    - '--- &athe option provided, or lists available locales.'
    
    - '&b/<cmd> setup &f- &aShows your settings.'
    
    - '&b/<cmd> &f- &aLists your current cooldowns.'
    
    setup:
    
    - 'Your settings: (American English)'
    
    - '&aGlobals&f:'
    
    - '-- Warmups... &a<global_warm>'
    
    - '-- Cooldowns... &a<global_cool>'
    
    - '&aInterrupts&f:'
    
    - '-- Movement... &a<movement>'
    
    - '-- Commands... &a<commands>'
    
    - '-- Damage... &a<damage>'
      
    # set any _generic_ key to null to disable it
    
    # ------- #
    
    # warmups #
    
    # ------- #
    
    warmup:
    
    start:
    
    _generic_: "'&b<cmd>&f' se zpracovava. (&b<wu>&f)"
    
    status:
    
    _generic_: "'&b<cmd>&f' se stale zpracovava. (&b<wu>&f)"
    
    done:
    
    _generic_: "'&b<cmd>&f' zpracovan."
    
    cancel:
    
    _generic_: "&cZrusil jsi zpracovani '&3<cmd>&c'."
    
    _movement_: "&cPohnul jsi se a zpracovani '&3<cmd>&c' se zrusilo."
    
    _damage_: "&cNekdo te zranil a zpracovani '&3<cmd>&c' se zrusilo."
      
    # --------- #
    
    # cooldowns #
    
    # --------- #
    
    cooldown:
    
    start:
    
    _generic_: "'&b<cmd>&f' is now cooling down. (&b<cd>&f)"
    
    status:
    
    _generic_: "'&b<cmd>&f' is cooling down. (&b<cd>&f)"
    
    done:
    
    _generic_: "You are ready to use '&b<cmd>&f' again."
    Code:
    My config file:
    
    plugin:
    
    # put the worlds you want to manage cooldowns and warmups in here
    
    worlds:
    
    - 'world'
    
    - 'world_nether'
    
    default_locale: 'en_US'
    
    available_locales: [en_US]
    
    # colors: true will enable logging in color (this will only work on non-windows platforms)
    
    colors: true
      
    groups:
    
    # -----------------
    
    default:
    
    # prefix applies to messages sent by this plugin to the player, such as status messages
    
    # it does not change chat settings, and should not interfere with any other plugins
    
    prefix: '[default] '
    
    interrupts:
    
    movement: true
    
    damage: true
    
    command: true
    
    globals:
    
    cooldowns: true
    
    warmups: true
    
    # _all_ will match all commands (for a root node), or all arguments for a sub-node
    
    # _self_ will match the command sender's name
    
    # all values specified are in seconds.
    
    commands:
    
    warmup:
    
    _all_: 5
    
    cooldown:
    
    _all_: 5
    
    # -----------------
    
    users:
    
    prefix: '[user] '
    
    interrupts:
    
    movement: true
    
    damage: true
    
    command: true
    
    globals:
    
    cooldowns: true
    
    warmups: true
    
    commands:
    
    warmup:
    
    kill: 5
    
    home: 2
    
    warp:
    
    home: 2
    
    _all_: 5
    
    cooldown:
    
    home: 60
    
    warp:
    
    home: 60
    
    _all_: 120
    
    # -----------------
    
    admins:
    
    prefix: '[admin] '
    
    interrupts:
    
    movement: false
    
    damage: false
    
    command: true
    
    globals:
    
    cooldowns: true
    
    warmups: true
    
    commands:
    
    warmup:
    
    kill: 2
    
    tp:
    
    _self_: 2
    
    _all_: 2
    
    time: 2
    
    cooldown:
    
    kill: 5
    
    tp:
    
    _self_: 60
    
    _all_: 120
    
    time: 5
    Code:
    My plugins:
    
    AutoMessage
    
    BackToBody
    
    BlockHat
    
    CFBanner
    
    CommandBook
    
    CraftBook
    
    CraftBookCircuits
    
    CraftBookMechanisms
    
    CraftBookVehicles
    
    creaturebox
    
    dynmap
    
    HeroicDeath
    
    ChestShop
    
    IBICF
    
    iConomy
    
    ItemScanner
    
    KiwiAdmin
    
    LightVote
    
    Lockette
    
    LogBlock
    
    LogBlockQuestioner
    
    MCTelnet
    
    mChat
    
    mChatEssentials
    
    Minequery
    
    MobArena
    
    MyHome
    
    OddItem
    
    OddItem
    
    PermissionsEx
    
    pmChat
    
    Questioner
    
    rawcritics_ore_obfuscation_plugin_spout
    
    Spout
    
    Towny
    
    VanishNoPickup
    
    War
    
    WorldEdit
    
    WorldGuard
    
    xAuth
    
    xWarp

    Screenshot of problem:
    Show Spoiler

    [​IMG]
     
  9. Offline

    krinsdeath

    @Boos - Can you put those config files on pastebin.com? The formatting is lost in the code brackets, so I can't tell if there's some indentation problem.

    This stuff works for me, so I am thinking it must be your locale file.

    [​IMG]
     
  10. Offline

    Boos

    http://pastebin.com/9en2FGML
    http://pastebin.com/Kbit8upg
     
  11. Offline

    krinsdeath

    Yeah, I'm sorry. Apparently there's some weird glitch with the _all_ key where it won't print out all of the normal messages. I'm working on it.
     
  12. Offline

    Monkz

    Can you help me with permissions? I showed u many posts ago what i was doing, when you said it should work, but it doesnt work. I use PermissionsEX running the compatability for bukkitperms and 2.7.x and it seems to put people as default regardless if i put - -cooldowns.default, and - cooldowns.admins for the permissions.

    If theres an issue with 2.7.x permissions or bukkitpermissions, can you make either compatible please? :D
     
  13. Offline

    krinsdeath

    I would love to say "I'll make it compatible," but to be honest, I don't want to hook 30 different plugins just to make permissions work properly. If there's an issue getting this to work properly in PermissionsEx, it's because PermissionsEx is doing something wrong when registering permissions for each player. I've spoken with some people and apparently in order for Pex to properly detect my permissions I need to develop specifically for Pex, which I am not going to do. Bukkit permissions are there to make developers' lives easier by not requiring us to hook a bunch of different plugins. I suggest moving to PermissionsBukkit, but in version 1.1 for this plugin I'll include a "priority" node for groups so that you don't need to worry about negative permissions and supporting older systems like Permissionsex.
     
  14. Offline

    louis058

    I'm using PermissionsBukkit, bukkit version 1060, and I've noticed some problems.

    After I use one command, while it is cooling down, I can't use other commands that require warm-ups/cooldowns. However, I can use other commands that don't require warmups/cooldowns. For example, if I use /home (which has a warmup and cooldown time), afterwards, I cannot use /spawn (which also has a warmup and cooldown) until /home finishes cooling down. While this might have been deliberate, I don't wish it so, and I can't find a configuration option that disables this. I tried removing the command interrupt in the config.yml, but that didn't do it either (I assume that this will just interrupt the warming up if I use a command during that time).

    Also, when I used /home, then did a /spawn, and interrupted /home by moving, every command that has warmups/cooldowns stopped working. I also had command interrupting turned off while I did this, but /spawn didn't go through, but it should have got interrupted by moving as well. This seems like a much more rarer case, but maybe worth noting. I think if I delete the player data in the CoolDowns folder, it will start working again, haven't tried yet. After this though, I'm turning on command interrupting again, just in case.
     
  15. Offline

    Monkz

    This is the only plugin thats not working. PermissionsEX just runs compatability for all the major permissions out there. It has compatability layers for 2.7.x, 3.1.x, and bukkit permissions. That's why i dont get it. I have permissions for every plugin working, even using some plugins that require bukkit permissions such as Vampire. So i don't know why this plugin won't hook :S

    Also some players on my server were experiencing negative numbers as their cooldowns. :S

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

    fffizzz

    Im moving to BukkitPermissions as soon as herochat updates, but in the mean time, does this still work on permissions 2.7.4?
     
  17. Offline

    krinsdeath

    @fffizzz - It does not. I've got a lot of projects (with a lot of requests), so I'm prioritizing things that absolutely need to be addressed first. I'll be doing a 2nd major rewrite for this plugin in the future, but in the mean time I'm hoping for actual bug reports and the like to continue fixing the current revision.

    Until then, I suggest running PermissionsBukkit with SuperpermsBridge, and mChat or my own ChatSuite.
     
  18. Offline

    Thequickthinkin

  19. Offline

    CoyleTrydan

    I'm not sure, but I seem to be getting an issue where if I switch someone from one permission group to another (say, from user to admin) the Cooldowns plugin still sees them as their old type (user). It seems like perhaps my users.dat isn't updating? Is there a way to get Cooldowns to refresh? (Restarting the server didn't do the trick.)
    Love the plugin, thanks for all your work!
     
  20. Offline

    krinsdeath

    @CoyleTrydan - It's a known issue, I've fixed it in 1.1. I've still got a number of things to do before releasing 1.1, however, so you'll just have to live with it for now.

    I apologize for the inconvenience.
     
  21. Offline

    CoyleTrydan

    Gotcha, alright. Thanks!

    UPDATE: By the way, I found that stopping the server, deleting users.dat, and then restarting the server so that Cooldowns recreates the file seems to work. Just as a workaround in case any others are having this issue. :)
     
  22. Offline

    krinsdeath

    Alright! v1.1 is done! Just pushed it, but it fixes a number of the problems you've all been encountering. I apologize for the wait!

    This was compiled and built against CraftBukkit 1060, but I do not believe it is 100% required (CB1000 should work fine).
     
  23. Offline

    Xickle

    Same here... it won't work with PEX, even though every other plugin works just fine :/
     
  24. Offline

    ToxicShade

    Just tested it on rb1858 the issue that CoyleTrydan mentioned still persist in version 1.1 only way to update is deleting user.dat and restarting server.
     
  25. Offline

    Marthaan

    I have this for /home.
    I noticed that it is case-sensitive? So as soon as a player writes /HOME they teleport instantly. Can I prevent this somehow?
     
  26. Offline

    Alexi Kantelus

    Plz update this to 1240 and fix case-sensitive thing, our server need plugin like this :s
     
  27. Offline

    heifinator

    Would love to see this updated with a fix for the case sensitivity!
     

Share This Page