[MECH] HealingWater 1.6 - Gain health in water [R3]

Discussion in 'Inactive/Unsupported Plugins' started by nickrak, Jun 11, 2011.

  1. Offline

    nickrak

    HealingWater - Gain health in water
    Version: 1.6

    Adjustable health gain by being in water. Variable rate of health gain, and health gain amount, can be configured to cause damage in water.

    Features:
    • Heals any player whose feet are in water.
    • Adjustable healing rate and amount.
    • Negative heal amount for damage.
    • All of the above but with Lava as well!
    Configuration:
    Configuration file is gone, everything is in permissions now.

    Permissions: (uses SuperPerms)

    Code:
    #Permission nodes are additive, if you group heals 2
    #but the user damages by three, you will take one damage in water.
    #Without permissions, HealingWater will default to the config file.
    #Please note that having the permission '*' does nothing for this plugin.
    #The healingDelay still comes from the config file.
     
    - healingwater.heal.1        # heals one half-heart per second in water
    - healingwater.heal.10      # heals ten half-hearts per second in water
    - healingwater.damage.10    # damages ten half-hearts per second in water
     
    - healingwater.lava.heal.1 # heals on half-hear per second in lava
    - healingwater.lava.damage.10 #damages ten half-hearts per second in lava
     
    #By default you will heal as long as you have air left.
    #There are nodes to change this.
     
    #The aquatic node makes you heal when you have no breath left.
    - healingwater.mode.aquatic
     
    #The hydrophobic makes you not heal when underwater, hydrophobia takes precedence over aquatic
    - healingwater.mode.hydrophobic
    
    Download Jar
    Github

    If you have feature requests, or bug reports, you 'can' post them here but I would really appreciate those with GitHub accounts post them on the GitHub issues page.

    Licensed under: Creative Commons 3.0: Attribution, Non-commercial, Share-Alike
    [​IMG]


    To-Do List:
    • Selective healing water by standing in a pool.
    Change Log:
    Version 1.6
    • Updated to R3.
    • Updated to new Bukkit Event system.
    Version 1.5
    • Now uses Bukkit Scheduler.
    • Fixed onReload issue.
    Version 1.4.3
    • Added checks for vehicles.
    Older Versions:
    Show Spoiler
    Version 1.4.2
    • Added support for lava
    Version 1.4.1
    • Fixed NullPointer when /reload is used while players are logged in.
    Version 1.4
    • Changed Permission system to SuperPerms.
    • Removed config file.
    • Pushed to GitHub
    Version 1.3.3
    • Bug Fix: exception on plugin disable caused by unneeded code.
    Version 1.3.2
    • Bug Fix: players logged in during a /reload will act as expected.
    Version 1.3.1
    • Updated Bukkit dependency to version used in CB935.
    Version 1.3
    • Added permission, with variable heal amount per group/user.
    Version 1.2
    • Fixed crash bug when negative healing caused death.
    Version 1.1
    • Added Air mode to change the healing behavior while unable to breath.
    Version 1.0
    • Initial Release
     
  2. Does this check to see if they can breathe or not? I can see people healing faster than they drown if you're not careful.
     
  3. Offline

    nickrak

    I added a configuration option to change the "drowning behavior".
     
  4. Isn't it nice when you don't have potential bugs?
     
    isaac13_13 likes this.
  5. Offline

    cholo71796

    Baptism makes so much more sense now.
     
  6. Offline

    Zixt

    Can you make it so you can specify a specific area of water that heals you? A 'healing pool' at a server spawnpoint, but not everywhere, could be nice.
     
  7. I like Zixt's idea. Zelda Fairy Fountains.
    Being able to set up a tiny cubiod would be great.
     
  8. Offline

    Toni

    Is it possible for you to create permission nodes + multi-group support for this plugin?

    I want it for VIP's only and I have 2 levels of VIP

    Silver and Gold. Wish it was Multi group so I could adjust the rate for silver to be like 0.5 every 5 secs and for Gold 1.0 every 1 second.
     
  9. Offline

    nickrak

    I'll add permissions to the next verison.

    How exactly would you want to define the healing water? By block or by 'worldedit'-style selection?
     
  10. Offline

    Drdetroit

    Woo! The exact opposite plug in i was looking for! Can i set this to Negative Damage??

    I want players to not be able to swim where they are not sappost to. and if this could do it would would love ya!

    Tested it out It seemed to work as soon as i logged in. I was standing in water and died. aftr that nothing would happen. I checked my log and got this.
    Code:
    2011-06-21 02:19:12 [SEVERE] Exception in thread "Thread-6"
    2011-06-21 02:19:12 [SEVERE] java.lang.IllegalArgumentException: Health must be between 0 and 200
    2011-06-21 02:19:12 [SEVERE]     at org.bukkit.craftbukkit.entity.CraftLivingEntity.setHealth(CraftLivingEntity.java:39)
    2011-06-21 02:19:12 [SEVERE]     at nickrak.HealingWater.HealingWater.run(HealingWater.java:170)
    2011-06-21 02:19:12 [SEVERE]     at java.lang.Thread.run(Unknown Source)
    and here is the config:
    Code:
    healingDelay=500
    
    healingAmount=-0.5
    
    healAirMode=HEAL_ALWAYS
    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: May 16, 2016
  11. Offline

    Zixt

    I think Worldedit style selection would be best. Or you can stand in a small pool, type a command and the plugin detects all water blocks linked to where you are right now and turns them into a healing pool?
     
  12. Offline

    nickrak

    I really like the idea of standing in a pool and linking to that. I'll probably post an updated in the next couple days.

    I'll post a patch for this tonite.

    Patched the crash-on-death IllegalArgumentException.
    Also added Permissions nodes.

    Will add healing pools next time.

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

    Zixt

    Nice. Will download when added :)
     
  14. Offline

    Drdetroit

    I'm still getting this error when i restart server. Should i just Keep the heal amount to 1 in config? and then add
    healingwater.damage.10 for permissions?

    EDIT: I Changed the Heal amount to 1 and gave the healingwater.damage.10 permission to the basic group, and it did work! But for some reason ignores me? Is it cuz i am admin and have '*' Permission?

    Thanks for your plugin.
     
  15. Offline

    nickrak

    What version of craftbukkit and what version of permissions are you using?
     
  16. Offline

    manura133

    Uhhh...nice. I have some kind of the same problem. HealingWater ignores me as an Admin, too. I have no errors in the log, but it ignores me. As an Admin I have '*' permissions, but it won't work until I add 'healingwater.heal.1' to the admin permissions. Strange...
    But maybe it is me who is a bit dumb, because I really don't know what is 'healingwater.damage.10' for?!
    CB #860, Permissions 3.1.5b, HealingWater 1.3

    Anyway, thanks for the great plugin @nickrak , I like it.
     
  17. Offline

    Drdetroit

    damage.10 is so i can kill people if they go in water. =p so they don't go where they are not sapost to.

    And i am also running CB 860Permissions 3.1.5b and healingwater 1.3
     
  18. Offline

    nickrak

    It doesn't use the standard permissions hook, I pull all permissions and look for healingwater.heal.# or healingwater.damage.#

    I can't use '*' because the number is used to determine how much health or damage you receive.

    That would probably be the issue you had before, can't rely on * cause it doesn't specify how much healing/damage to do. And don't forget that healingwater.damage.10 does 10 half-hearts of damage.
     
  19. Offline

    manura133

    Ok, I understand that. So, I think, I will give user based permissions instead of group based.
     
  20. Offline

    nickrak

    You can still use groups and users together, and the values will add up, so if the user has heal.1 and the group has damage.1. The player will take no damage and receive no healing.
     
  21. Offline

    Steelstiletto

    I'm having issues with this. I have permissions set up and working, and the admin group has 'healingwater.heal.4' in it, but I can't heal. My other user is reporting it not working too.

    Code:
    # Healing Water Configuration.
    
    # healingDelay=[millisecond delay between consecutive healing]
    
    # healingAmount=[number of healts to heal]
    
    # healAirMode=[ HEAL_ALWAYS | HEAL_WITH_FULL_AIR | HEAL_WITH_SOME_AIR ]
    
    #
    
    # Defaults: healingDelay=500, healingAmount=0.5 ... heals half a heart every half a second, healAirMode=HEAL_WITH_FULL_AIR
    
    healingDelay=1000
    
    healingAmount=1
    
    #healAirMode=HEAL_WITH_FULL_AIR
    healAirMode=HEAL_ALWAYS
    Code:
    users:
        steelstiletto:
            groups:
            - Admins
            permissions:
        DiceGolem:
            groups:
            - Member
    Code:
    ##
    # Permissions has AntiBuild, which prevents a player from destroying/placing blocks.
    # To prevent a group of players then set the build: flag to false (build: false).
    # If you want a group to be able to build then set it to true.
    ##
    # Groups can inherit from other groups.
    #   To make a group inherit the permissions and info nodes from another
    #   group, simply place the groups name in the "inheritance:" like so:
    #
    #   Example:
    #       inheritance:
    #           - Default
    ##
    #   Wildcard Permission settings:
    #
    #       You can have wildcard nodes which encompass all nodes that match it.
    #       For example, the node "modplugin.*" matches "modplugin.kick", "modplugin.ban",
    #       "modplugin.settings.view", and so on.
    #
    ##
    #   A single asterisk means that this user/group has all permissions.
    #       - '*'
    ##
    #   Negated nodes are created by prefixing a normal node with "-".
    #   They prevent less specific wildcard nodes from matching the negated node.
    #   For example:
    #
    #   permissions:
    #       - 'foo.*'
    #       - '-foo.bar'
    #
    #   In this case, the user/group will have "foo.foo", "foo.foobar", and so on, but not "foo.bar".
    #
    ##
    #   prefix: and suffix: do not do anything on their own.  You need another outside plugin
    #   such as iChat or HeroChat in order for these to do anything.
    ##
    #
    #   For more info, visit https://github.com/TheYeti/Permissions/wiki/Guide-to-creating-YAML-configs
    #
    ##
    
    groups:
        Default:
            default: true
            info:
                prefix: ''
                suffix: ''
                build: false
            inheritance:
        Member:
            default: false
            info:
                prefix: ''
                suffix: ''
                build: true
            inheritance:
                - Default
            permissions:
        Moderator:
            default: false
            info:
                prefix: ''
                suffix: ''
                build: true
            inheritance:
                - Member
            permissions:
        Admins:
            default: false
            info:
                prefix: ''
                suffix: ''
                build: true
            inheritance:
            permissions:
                - '*'
                - 'healingwater.heal.4'
     
  22. Offline

    nickrak

    Quotes are only valid on *, remove the single-quotes around the healingwater.heal.4 and it should work.
    The configuration you posted should work only on the admin, not for other players. And should always heal while in water (even while drowning), 4 hearts per second.
     
  23. Offline

    manura133

    Just found another issue/bug. When I'm in my Nether world your plugin heals me by default, but there is no water in the Nether. :)
     
  24. Offline

    Steelstiletto

    Awesome, thank you. That was the issue.

    Hmm, my issue now seems to be that it only works once after you log in, then you have to log out and back again before it heals you...

    Oh, nevermind. It doesn't work after server reloads until you relog. That was the issue. But I'm currently having to do a lot of server reloads...

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

    nickrak

    Patch 1.3.2 fixes the server reload problem.

    I have been unable to duplicate this. What other plugins, bukkit version, permissions version if any are you running?
     
  26. Offline

    manura133

    Yesterday it was CB #860 with Permissions 3.1.6, but now it is the same with CB #946 and Permissions 3.1.6.
    My other plugins:
    [​IMG]
    My thought is that I would be under water in the normal world when I enter the Nether. I mean these multiple worlds are something like the same but different layers or not. May it be that the normal world still interact with your plugin while you are in the Nether?!
     
  27. Offline

    nickrak

    Permissions 3.x is required and you have that. (Assuming that you renaming it hasn't broken it).
    CB 860 should be fine, I haven't tested with CB 946 yet.

    Actually that's the opposite of how it is, the nether is a completely separate world altogether. The block you are standing in is world dependent and not arbitrarily selected. The code simply doesn't allow for that situation. In my testing, with using WorldEdit to force the existence of water at a location known to have water in other worlds, I cannot replicate your problem.
     
  28. Just to be sure, you're taking player.getLocation().getBlock() right? If that's it, then there's no chance for argument that it's the wrong world.
     
  29. Offline

    nickrak

    That is exactly what I do.

    Code:
    final Material m = player.getLocation().getBlock().getType();
    if ((m == Material.WATER || m == Material.STATIONARY_WATER) && configCheck(player))
    {
        // heal or damage
    }
    
     
  30. Offline

    TruffleDucks

    How does the config work with the healing_with_some_air,full_air,always work?
     

Share This Page