[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. You'll have a hard time continuing to support the old Permissions when they aren't being updated.
     
  3. Offline

    riolu447

    Are super perms and PEX the samething? I thought super perms was the bukkit built in one? PEX is still being updated (i think)... I guess any help i can get would be useful... I'm still kind of new to all of this.

    Thanks!
     
  4. SuperPerms is the built in system. PEX is a separate plugin.
     
  5. Offline

    nickrak

    PEX is SuperPerm compatible. I will not be providing special support for any permission systems outside of SuperPerms once I move off of the old Permission system.
     
  6. Offline

    riolu447

    Ok, thanks for the info! I guess the next thing would be if one of you all could help me figure out how to set it up to the point that it will work (with PEX or SuperPerms or whatever...) it would be greatly appreciated by everyone on my server.

    Thanks again!
     
  7. Offline

    riolu447

    Hello? Is there anyone who can help me set this up in SuperPerms so that it will work with PEX or just get it working on my server?

    Thanks!!
     
  8. Offline

    nickrak

    I have not posted the update for SuperPerms yet.
     
  9. Offline

    nickrak

    Note to everyone: 1.4 is out, now supports SuperPerms.
     
  10. Offline

    1cec0ld

    Running CB 1240, HealingWater version 1.4, EssentialsGroupManager, EssentialsGroupBridge, and my permissions file looks like this:
    Show Spoiler
    Water:
    default: false
    permissions:
    - acidrain.immune
    - essentials.protect.damage.contact
    - essentials.protect.damage.creeper
    - essentials.protect.damage.fall
    - essentials.protect.damage.fireball
    - essentials.protect.damage.projectiles
    - essentials.protect.damage.suffocation
    - essentials.protect.damage.tnt
    - essentials.protect.entitytarget.bypass
    - essentials.protect.pvp
    - fastfood.instanteat
    - fastfood.nostarve
    - healingwater.heal.2
    - healingwater.mode.aquatic
    inheritance:
    - ether
    info:
    prefix: ''
    build: true
    suffix: of &1Water


    The only error I could find on the server was during a /reload, looked like this:
    Code:
    >11:56:50 [SEVERE] Exception in thread "Thread-8743"
    >11:56:51 [SEVERE] java.lang.NullPointerException
    >11:56:51 [SEVERE] at nickrak.HealingWater.HealingWater.run(HealingWater.java:114)
    >11:56:51 [SEVERE] at java.lang.Thread.run(Unknown Source)
    The plugin isn't working for me in the damaging or healing side, I hope this error is the cause, and has a simple fix.
    Thank you for your time to read this, and effort to keep this plugin working. If you need any other information, please let me know.
     
  11. Offline

    nickrak

    Thanks for catching that. Posted a patch just now.
     
  12. Offline

    1cec0ld

    @nickrak

    Ok, I tested the patch, but I'm still getting no effect on my server. Is it a problem with my EssentialsGroupManager + EssentialsGroupBridge combo? Or do I need to update to CB 1317 ? Permissions file (not in code form, sorry) for one of my groups is above.

    Thanks for any advice.
     
  13. Offline

    nickrak

    I'm unfamiliar with EssentialsGroupManager, but as long as it's SuperPerms compatible, it should be fine.
    You should not need to update to CB1317, all the features I use from Bukkit have been around for a long time.
    Your permissions file looks fine to me.

    Maybe double-check your spaces in the permissions yml. Double check your logs to make sure there's no errors. If you run into further issues, PM me and I'll send you a debug build so we can track down the issue.
     
  14. Offline

    1cec0ld

    @nickrak

    Ok, I had to download my log and Ctrl+F "healing" but here's the newest one I found, right AFTER a short stint where it worked. It healed me, I tried to switch my rank (failed due to lack of permissions), then this error spit out. I switched to the other rank using SignRank, then went back to Water Type. No more healing.

    Error:
    Code:
    2011-10-19 01:10:10 [SEVERE] Exception in thread "Thread-8"
    2011-10-19 01:10:10 [SEVERE] java.lang.IllegalArgumentException: Health must be between 0 and 200
    2011-10-19 01:10:10 [SEVERE]     at org.bukkit.craftbukkit.entity.CraftLivingEntity.setHealth(CraftLivingEntity.java:40)
    2011-10-19 01:10:10 [SEVERE]     at nickrak.HealingWater.HealingWater.run(HealingWater.java:134)
    2011-10-19 01:10:10 [SEVERE]     at java.lang.Thread.run(Unknown Source)
    
    Permissions for Water Group (edited with in game command, so no possible yml issues)
    Show Spoiler

    Code:
      Water:
        default: false
        permissions:
        - acidrain.immune
        - essentials.protect.damage.contact
        - essentials.protect.damage.creeper
        - essentials.protect.damage.fall
        - essentials.protect.damage.fireball
        - essentials.protect.damage.projectiles
        - essentials.protect.damage.suffocation
        - essentials.protect.damage.tnt
        - essentials.protect.entitytarget.bypass
        - essentials.protect.pvp
        - fastfood.instanteat
        - fastfood.nostarve
        - healingwater.heal.10
        inheritance: []



    Edit: lol and then it works again after a reload. Currently playing with reload and changing permissions to see if it's stable and if I can create the error again.
    Edit Update: Ok. It seems to save the changes when I save-all and reload. I have 2 groups, Fire and Water, each taking 2 damage and healing 2 damage respectively. When I change my rank from one to the other in game, it saves the old damage/heal setting. So if I start as Fire, and i /manuadd (name) water; I still take 2 damage. Until-I relog. Then I start healing again. Not a game breaker, but something you may or may not care about. I don't know why the plugin suddenly started working for me. I'm not going to question it. :)
     
  15. Offline

    nickrak

    That error at the beginning seems impossible... if you can tell me how to reproduce that I can fix it.

    As for the permissions/reload shenanigans, that sounds correct, I cache the heal/damage values from permissions since SuperPerms makes it difficult to get integer values from the permission nodes without checking all possibilities (which is obviously a bit cpu intensive with lots of people on, specifically 40 permission checks per player in water per second). But I do not cache the drowning-mode, so that will update when you change permissions. You can update the cache either by reloading the plugin, or logging out and in again.

    Going forward, I can possibly make a command to force-refresh the cache, or make it possible to disable the cache for low-volume servers. Open to suggestions if anyone has any better ideas.
     
  16. Offline

    1cec0ld

    Ok, as hard as I've tried, I can't do it :D
    All I remember is: I was underwater, no air, exploiting the fact that zombies can't sink, as I beat him up. My current theory is that he hit me when I swam up to the surface, at the same time as I was regenerating? That may have caused the error of health value? Again, I'm failing at reproducing it, so no idea what the actual cause was. Thanks for caring though! If I get it again, I'll just /reload and it should be fine and working again, that's what fixed it last time.
     
  17. Offline

    riolu447

    Hi I'm Back, My server has changed. We are now running PermssionsBukkit which is still SuperPerms compatable and I have no clue what I am doing. I gave myself the nodes healingwater.heal.20 and healingwater.mode.aquatic. When i start the server healing water appears to start up just fine... but when i step in water nothing happens... I go under, i stand... nothing. Is there something i have to do with the root permissions.yml to make this work? I have only done stuff in permsisonsbukkit config.yml at this point.

    So if some one doesn't mind explaining the difference between permssionsbukkit, superperms, and how they interact with each other and healing water and how I can get it to work I would much appreciate it!

    Thanks!!!
     
  18. Offline

    nickrak

    I have not tested with PermissionsBukkit, but I have tested with PEX. Those permission nodes are probably just not assigned correctly. I'm assuming you used this? or added to a group that had this?
    Code:
    /permissions [playername] setperm healingwater.heal.20
    /permissions [playername] setperm healingwater.mode.aquatic
     
  19. Offline

    riolu447

    xD when i used the command it worked
     
  20. Offline

    1cec0ld

    @nickrak
    Ok, this is only slightly related, but I had no other idea of where to go. I was just curious about how hard it would be to do the same thing (separate plugin or not) with "HealingLava"? Same concept, down to the permissions and everything, just blocks 10 and 11 instead of 8 and 9. Any thoughts you have on this would be appreciated.

    On a more relevant note, the plugin hasn't goofed up since that last error, so I'm thankful for that!
     
  21. Offline

    nickrak

    I'd be glad to add support for lava as a feature. Also, glad there have been no issues.
     
  22. Offline

    1cec0ld

    Thank you!!!!! Take your time, my server can wait :)
     
  23. Offline

    jamespellis

    Would it be possible for players to be hurt when swimming but not when in a boat? The server I run is an archipelago of islands and I would like to make it difficult but not impossible to cross. Thank-you in advance.
    -Jamespellis
     
  24. Offline

    nickrak

    Lava and the boat check are already in the code, I'm just waiting for the 1.0 RB to publish the jar. If you want to build it for whatever version of CB you're running, you can grab the code from the GitHub.
     
  25. Offline

    jamespellis

    Thanks
     
  26. Offline

    1cec0ld


    [diamond]
     
  27. Offline

    nickrak

    @1cec0ld Thanks for the reminder, I'll post the update tonite
     
  28. Offline

    1cec0ld

    Nice hat!
     
  29. Offline

    1cec0ld

    So is the update posted, with no change to Original Post? Or did something come up? I'm not one to take risks or assume something happened, I know how busy devs can get.
     
  30. Offline

    nickrak

    My bad, just was busy with finals. Got the update posted.

    Players in vehicles will no longer be affected by this plugin. Also, new permission nodes to add lava healing/damage on top of existing lava damage. (Is there interest in stopping standard lava damage if any lava nodes are defined for a player/group?, or just stopping lava damage entirely while this plugin is enabled?)

    Just a warning: there appears to be some issues with reloading. Working on a fix.

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

    1cec0ld

    Would healingwater.lava.heal.0 work to stop damage? All its doing is 'healing' 0 per second. Or does regular lava damage apply while the permission-holder is being healed?

    Testing it as soon as I'm done rewriting my permission file to work with PEX.
    Duly noted-reload bad, restart instead for now.
     

Share This Page