[FUN/GEN/MECH] SimpleHealth v0.3.3 - Simple Health Manager [1000]

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

  1. Offline

    krinsdeath

    SimpleHealth v0.3.3 - Commandless health regeneration for groups, with Permission support.​
    Version: 0.3.3​
    Version 0.3.3 requires CraftBukkit 1000
    (requested by @morizuki in this thread)
    New: Version 0.3.0 implements Bukkit's SuperPermissions, and works best with PermissionsBukkit. Configuration nodes are still the same, but are detailed below for your convenience.
    Description:
    SimpleHealth allows you to define custom "groups" with different health regenerations or respawn values, as well as the ability to disable certain commands (by group) altogether. A default configuration is supplied in this post.

    Basic Usage:
    Drop SimpleHealth.jar into your plugins directory, and it'll do the rest. By default, permissions is disabled, and peaceful mode is set to false. I did my best to document what each configuration option does, but if there are any questions, just let me know.

    Commands: None. Configuration and interaction is done through the config.yml.

    config.yml (open)
    Code:
    # If you're using permissions, the default configuration nodes are 'simplehealth.users' and 'simplehealth.admins'
    # You can specify as many groups in this file as you want, and include them in permissions with 'simplehealth.[groupname]'
    # If you're not using permissions, the default group names of 'users' and 'admins' can't be changed (it will throw errors if you change them)
    plugin:
      # Any worlds specified here will have regeneration applied to them. Worlds not specified will remain unaffected.
      worlds:
        - 'world'
        - 'world_nether'
      # If your server uses peaceful mode, and you don't want users to regen super fast
      # Any worlds specified here will have no natural health regeneration
      # This will negate the fast regen effect of peaceful servers
      natural_regen:
        - 'world'
        - 'world_nether'
      # Any worlds specified here will have blocked PVP combat.
      pvp:
        - 'world_nether'
      permissions: false
      default_locale: 'en_US'
      locales: [en_US]
    
    groups:
      users:
        regen:
          # rate in seconds that the user regenerates health (0 for disabled)
          rate: 30
          # amount in health (2 health = 1 heart) per regeneration tick
          amount: 1
        disabled_commands:
          # '*' will match all commands
          - 'warp'
        events:
          # these values will influence the amount of health upon certain events
          # the values may be modified freely, but don't exceed 20 or enter 0
          # currently, only _respawn works.
          # TODO:
          #   _damage: floor damage inflicted to the amount specified in this config
          # _damage: 0 (god mode?)
          _respawn: 1
        items:
          # any value specified after a material name will cause the player to gain health after using it
          # you could even specify "stone" or "obsidian" to heal players
          # values specified here will override default game values
          # If you specify a block (stone, obsidian, etc), the block will be consumed until the player's health is full
          # at which point the block will be placeable normally again
          # negative values can be given
          pork: 3
          grilled_pork: 6
      admins:
        regen:
          rate: 10
          amount: 1
        disabled_commands:
        events:
          _respawn: 20
        items:
          pork: 10
          grilled_pork: 20
    

    localizations (open)

    Code:
    # Only variables contained in <> are parsed in the "plugin" section
    # Colors will not be parsed. These are console messages.
    plugin:
      enabled: "<fullname> loaded."
      disabled: "<fullname> disabled."
      loaded: "American English localization loaded."
      log_prefix: "[<name>] "
      permissions:
        loaded: "Permissions (v<permissions_version>) found."
        failed: "Permissions not found. Defaulting to isOp()."
      user_created: "User '<user>:<group>' created."
      peaceful_enabled: "Peaceful mode is enabled for <world>"
    

    Permissions (open)

    Using the default configuration, permissions flags are "simplehealth.users" and "simplehealth.admins"

    If you configure more than just the initial two groups, each group will have a permissions key equivalent to the group name, and the keys are case sensitive:
    simplehealth.VIP
    simplehealth.Moderators

    If you want to define a default group in which Health Regen doesn't work, copy one of the groups and set all of the values to 0, and then use that node "simplehealth.default" for your default group.

    example expanded groups (open)

    Code:
    plugin:
      peaceful: false
      peaceful_worlds:
        - 'world'
        - 'world_nether'
      permissions: false
      default_locale: 'en_US'
      locales: [en_US]
    
    groups:
      default:
        regen:
          rate: 300
          amount: 0
        disabled_commands:
          - 'warp'
          - 'home'
        events:
          _respawn: 1
        items:
          pork: 1
          grilled_pork: 1
      Users:
        regen:
          rate: 30
          amount: 1
        disabled_commands:
          - 'warp'
        events:
          _respawn: 5
        items:
          pork: 3
          grilled_pork: 6
      VIP:
        regen:
          rate: 5
          amount: 1
        disabled_commands:
        events:
          _respawn: 10
        items:
          pork: 3
          grilled_pork: 6
          obsidian: 5
      Moderator:
        regen:
          rate: 3
          amount: 1
        disabled_commands:
        events:
          _respawn: 15
        items:
          pork: 5
          grilled_pork: 10
          obsidian: 5
          stone: 5
      Admins:
        regen:
          rate: 1
          amount: 1
        disabled_commands:
        events:
          _respawn: 20
        items:
          pork: 20
          grilled_pork: 20
          obsidian: 20
          stone: 20
    

    example expanded permissions (open)

    simplehealth.default - for default group
    simplehealth.Users - for your normal users
    simplehealth.VIP - for your power users or paid users
    simplehealth.Moderator - for your mods
    simplehealth.Admins - for your administrators


    Features:
    • Configurable Health regeneration for users based on groups, through permissions
    • Configurable "health on respawn" by groups
    • Disable commands by alias (even if not registered through permissions)
    Issues:
    • Respawning causes a brief grunt by the player if you specify values less than 20, caused by the game inflicting damage to the player. I have not figured out how to remove this.
    • Reloading the plugin after deleting a loaded configuration causes some glitchy behavior, and may break the plugin. Simply restart the server, and it'll remake the configurations.
    Changelog:
    Version 0.3.1 (Latest):
    • Removed NMS dependencies
    Version 0.3.0:
    • Updated to use SuperPerms. Will work without permissions, and default users to 'users' and ops to 'admins'.
    • Addressed possible stability and concurrency issues from using TimerTask, instead I'm using the bukkit scheduler now.
    Version 0.2.0:
    • Renamed to SimpleHealth
    • Added items keys, you can now change the default health of items you consume, including making blocks (stone, dirt, etc) heal or hurt you by "eating" them.
    • Cleaned up the code and added some localization options
    • Added flag to control regeneration on peaceful mode servers. If you want to manage health on a peaceful server, set peaceful: true, and your players will regenerate at the rate you specify!
    Version 0.1.2:
    • Fixed peaceful mode and non-peaceful mode overlapping and causing problems
    • Cleaned up code
    Changelog (open)

    Version 0.1.1:
    • Fixed max health overflow
    Version 0.1.0a:
    • Initial release
     
    morizuki likes this.
  2. Offline

    morizuki

    it's working perfectly fine.. just found one bug..

    i tried setting the regen rate to 3000

    but it still regen faster..

    even if i tried 30secs.. it's the same speed of regen..
     
  3. Offline

    Plague

    changelog has to show two latest versions without a spoiler
     
  4. Offline

    krinsdeath

    Sorry about that, didn't read that in the submission guidelines. :x
    Fixed now.
     
  5. Offline

    morizuki

    Code:
    ##
    # AntiBuild is included with this.  To disable a group from being able to build 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 contain inheritance.
    #   To make a group inherit the permissions from another
    #   group simply place the groups name in the "inheritance:" like so:
    #
    #   Example:
    #       inheritance:
    #           - Default
    ##
    #   Globalized Permission settings:
    #
    #       If a permission contains periods (.) you can denote a globalized parameter:
    #
    #           - 'foo.*'
    #
    #       This will allow you to use all general commands.
    #
    ##
    #   Single Asterisk denotes all commands:
    #
    #       - '*'
    ##
    #   To exempt a node use the - prefix like so:
    #       - '-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.
    groups:
        Novice:
            default: true
            info:
                prefix: '&eNovice'
                suffix: ''
                build: true
            inheritance:
            permissions:
                - 'timerank.buyrank'
                - 'citizens.trader.stock'
                - 'citizens.use.*'
                - 'mcmmo.commands.whois'
                - 'mcmmo.item.chimaerawing'
                - 'pvptoggle.command.toggle'
                - 'pvptoggle.command.status'
                - 'pvptoggle.use'
                - 'pvpreward.getreward'
                - 'pvpreward.givereward'
                - 'bog.*'
                - 'bof.*'
                - 'thunderjoin.join'
                - 'nocheat.notify'
                - 'iConomy.list'
                - 'nSpleef.member.join'
                - 'nSpleef.member.wager'
                - 'nSpleef.member.leave'
                - 'commandSigns.use'
                - 'buttonwarp.use'
                - 'chaircraft.sit'
                - 'GoldenRevive.Revive'
                - 'iWarning.mywarnings'
                - 'modtrs.command.modlist'
                - 'modtrs.command.modreq'
                - 'routeplanner.use'
                - 'mobbounty.collect'
                - 'deathcontrol.use'
                - 'deathcontrol.free'
                - 'buttonwarp.source'
                - 'invinciwolf.tele'
                - 'invinciwolf.own'
                - 'simpleregen.user'
        Unarmed:
            default: false
            info:
                prefix: '&dUnarmed'
                suffix: ''
                build: true
            inheritance:
            permissions:
                - 'citizens.trader.stock'
                - 'citizens.use.*'
                - 'mcmmo.commands.whois'
                - 'mcmmo.item.chimaerawing'
                - 'mcmmo.ability.unarmed'
                - 'mcmmo.ability.woodcutting'
                - 'mcmmo.ability.mining'
                - 'mcmmo.ability.herbalism'
                - 'mcmmo.skills.woodcutting'
                - 'mcmmo.skills.unarmed'
                - 'mcmmo.skills.herbalism'
                - 'mcmmo.skills.acrobatics'
                - 'mcmmo.skills.mining'
                - 'pvptoggle.command.toggle'
                - 'pvptoggle.command.status'
                - 'pvptoggle.use'
                - 'pvpreward.getreward'
                - 'pvpreward.givereward'
                - 'bog.*'
                - 'bof.*'
                - 'thunderjoin.join'
                - 'nocheat.notify'
                - 'iConomy.list'
                - 'nSpleef.member.join'
                - 'nSpleef.member.wager'
                - 'nSpleef.member.leave'
                - 'commandSigns.use'
                - 'buttonwarp.use'
                - 'chaircraft.sit'
                - 'GoldenRevive.Revive'
                - 'iWarning.mywarnings'
                - 'modtrs.command.modlist'
                - 'modtrs.command.modreq'
                - 'routeplanner.use'
                - 'mobbounty.collect'
                - 'deathcontrol.use'
                - 'deathcontrol.free'
                - 'buttonwarp.source'
                - 'invinciwolf.tele'
                - 'invinciwolf.own'
                - 'simpleregen.user'
        Archer:
            default: false
            info:
                prefix: '&bArcher'
                suffix: ''
                build: true
            inheritance:
            permissions:
                - 'citizens.trader.stock'
                - 'citizens.use.*'
                - 'mcmmo.commands.whois'
                - 'mcmmo.item.chimaerawing'
                - 'mcmmo.ability.archery'
                - 'mcmmo.ability.woodcutting'
                - 'mcmmo.ability.mining'
                - 'mcmmo.ability.herbalism'
                - 'mcmmo.skills.woodcutting'
                - 'mcmmo.skills.archery'
                - 'mcmmo.skills.herbalism'
                - 'mcmmo.skills.mining'
                - 'pvptoggle.command.toggle'
                - 'pvptoggle.command.status'
                - 'pvptoggle.use'
                - 'pvpreward.getreward'
                - 'pvpreward.givereward'
                - 'bog.*'
                - 'bof.*'
                - 'thunderjoin.join'
                - 'nocheat.notify'
                - 'iConomy.list'
                - 'nSpleef.member.join'
                - 'nSpleef.member.wager'
                - 'nSpleef.member.leave'
                - 'commandSigns.use'
                - 'buttonwarp.use'
                - 'chaircraft.sit'
                - 'GoldenRevive.Revive'
                - 'iWarning.mywarnings'
                - 'modtrs.command.modlist'
                - 'modtrs.command.modreq'
                - 'routeplanner.use'
                - 'mobbounty.collect'
                - 'deathcontrol.use'
                - 'deathcontrol.free'
                - 'buttonwarp.source'
                - 'invinciwolf.tele'
                - 'invinciwolf.own'
                - 'simpleregen.user'
        Swordsman:
            default: false
            info:
                prefix: '&aSwordsman'
                suffix: ''
                build: true
            inheritance:
            permissions:
                - 'citizens.trader.stock'
                - 'citizens.use.*'
                - 'mcmmo.commands.whois'
                - 'mcmmo.item.chimaerawing'
                - 'mcmmo.ability.swords'
                - 'mcmmo.ability.woodcutting'
                - 'mcmmo.ability.mining'
                - 'mcmmo.ability.herbalism'
                - 'mcmmo.skills.woodcutting'
                - 'mcmmo.skills.swords'
                - 'mcmmo.skills.herbalism'
                - 'mcmmo.skills.mining'
                - 'pvptoggle.command.toggle'
                - 'pvptoggle.command.status'
                - 'pvptoggle.use'
                - 'pvpreward.getreward'
                - 'pvpreward.givereward'
                - 'bog.*'
                - 'bof.*'
                - 'thunderjoin.join'
                - 'nocheat.notify'
                - 'iConomy.list'
                - 'nSpleef.member.join'
                - 'nSpleef.member.wager'
                - 'nSpleef.member.leave'
                - 'commandSigns.use'
                - 'buttonwarp.use'
                - 'chaircraft.sit'
                - 'GoldenRevive.Revive'
                - 'iWarning.mywarnings'
                - 'modtrs.command.modlist'
                - 'modtrs.command.modreq'
                - 'routeplanner.use'
                - 'mobbounty.collect'
                - 'deathcontrol.use'
                - 'deathcontrol.free'
                - 'buttonwarp.source'
                - 'invinciwolf.tele'
                - 'invinciwolf.own'
                - 'simpleregen.user'
        Axeman:
            default: false
            info:
                prefix: '&7Axeman'
                suffix: ''
                build: true
            inheritance:
            permissions:
                - 'citizens.trader.stock'
                - 'citizens.use.*'
                - 'mcmmo.commands.whois'
                - 'mcmmo.item.chimaerawing'
                - 'mcmmo.ability.axes'
                - 'mcmmo.ability.woodcutting'
                - 'mcmmo.ability.mining'
                - 'mcmmo.ability.herbalism'
                - 'mcmmo.skills.woodcutting'
                - 'mcmmo.skills.axes'
                - 'mcmmo.skills.herbalism'
                - 'mcmmo.skills.mining'
                - 'pvptoggle.command.toggle'
                - 'pvptoggle.command.status'
                - 'pvptoggle.use'
                - 'pvpreward.getreward'
                - 'pvpreward.givereward'
                - 'bog.*'
                - 'bof.*'
                - 'thunderjoin.join'
                - 'nocheat.notify'
                - 'iConomy.list'
                - 'nSpleef.member.join'
                - 'nSpleef.member.wager'
                - 'nSpleef.member.leave'
                - 'commandSigns.use'
                - 'buttonwarp.use'
                - 'chaircraft.sit'
                - 'GoldenRevive.Revive'
                - 'iWarning.mywarnings'
                - 'modtrs.command.modlist'
                - 'modtrs.command.modreq'
                - 'routeplanner.use'
                - 'mobbounty.collect'
                - 'deathcontrol.use'
                - 'deathcontrol.free'
                - 'buttonwarp.source'
                - 'invinciwolf.tele'
                - 'invinciwolf.own'
                - 'simpleregen.user'
        Tamer:
            default: false
            info:
                prefix: '&6Tamer'
                suffix: ''
                build: true
            inheritance:
            permissions:
                - 'citizens.trader.stock'
                - 'citizens.use.*'
                - 'mcmmo.commands.whois'
                - 'mcmmo.item.chimaerawing'
                - 'mcmmo.ability.taming'
                - 'mcmmo.ability.woodcutting'
                - 'mcmmo.ability.mining'
                - 'mcmmo.ability.herbalism'
                - 'mcmmo.ability.repair'
                - 'mcmmo.ability.excavation'
                - 'mcmmo.skills.woodcutting'
                - 'mcmmo.skills.taming'
                - 'mcmmo.skills.herbalism'
                - 'mcmmo.skills.mining'
                - 'mcmmo.skills.repair'
                - 'mcmmo.skills.excavation'
                - 'pvptoggle.command.toggle'
                - 'pvptoggle.command.status'
                - 'pvptoggle.use'
                - 'pvpreward.getreward'
                - 'pvpreward.givereward'
                - 'bog.*'
                - 'bof.*'
                - 'thunderjoin.join'
                - 'nocheat.notify'
                - 'iConomy.list'
                - 'nSpleef.member.join'
                - 'nSpleef.member.wager'
                - 'nSpleef.member.leave'
                - 'commandSigns.use'
                - 'buttonwarp.use'
                - 'chaircraft.sit'
                - 'GoldenRevive.Revive'
                - 'iWarning.mywarnings'
                - 'modtrs.command.modlist'
                - 'modtrs.command.modreq'
                - 'routeplanner.use'
                - 'mobbounty.collect'
                - 'deathcontrol.use'
                - 'deathcontrol.free'
                - 'buttonwarp.source'
                - 'invinciwolf.tele'
                - 'invinciwolf.own'
                - 'simpleregen.user'
        Moderator:
            default: false
            info:
                prefix: ''
                suffix: ''
                build: true
            inheritance:
                - Default
            permissions:
                - 'bar.foo'
        Admins:
            default: false
            info:
                prefix: 'GM'
                suffix: ''
                build: true
            inheritance:
            permissions:
                - '*'
    here's my permission..
     
  6. Offline

    krinsdeath

    Try redownloading the jar, I changed a bit in 0.1.1.

    Both versions (initial 0.1.0a and 0.1.1) work as expected for me, so I'm not sure what the problem is.

    What version of Permissions and CraftBukkit are you running? I'll compile it against them and see if I can find the problem.

    note: Your "Moderator" group has no permissions and inherits from an empty group. You can probably remove it altogether.
     
  7. Offline

    morizuki

    I'm using your 1.1 still the same.. also I'm using cb860.. can't upgrade it yet because of the other plugins..
    permission is 3.1.6..
     
  8. Offline

    krinsdeath

    I think I figured out the problem. Was an issue with peaceful mode and non-peaceful mode overlapping. New jar is up and it should be fine.

    Took a while to figure out why it was happening.
     
  9. Offline

    morizuki

    oh.. it's working now thanks :D
     
  10. Offline

    krinsdeath

    Alright. New version! 0.2.0! This adds a significant amount of new features, including the ability to manage the health restore rate of foods (and even allows you to specify blocks, that, if specified, will heal the player when he right clicks with them! If the player has max health, block placement works as normal)

    In addition, you can specify which worlds you want to apply peaceful mode to (rather than applying it static to every world) in a list!

    Feedback is very much appreciated, and please post any errors you encounter. Have fun!
     
  11. Offline

    JukeboxJohnny

    I'm currently using this with 1000 and it seems something just stops the health regeneration. I'm not entirely sure, but this happens to everyone. One second it will regenerate fine, then a second later it won't anymore.
     
  12. Offline

    krinsdeath

    Can you be a bit more specific? Your config.yml, would be great, as well as whether you're using multiple worlds.

    I haven't tested multi-world setups very much, so there could be some issues I missed. But yeah, more info please!
     
  13. Offline

    JukeboxJohnny

    Code:
    # If you're using permissions, the default configuration nodes are 'simplehealth.users' and 'simplehealth.admins'
    # You can specify as many groups in this file as you want, and include them in permissions with 'simplehealth.[groupname]'
    # If you're not using permissions, the default group names of 'users' and 'admins' can't be changed (it will throw errors if you change them)
    plugin:
      # If your server uses peaceful mode, and you don't want users to regen super fast
      # set peaceful to true
      peaceful: false
      peaceful_worlds:
        - 'world'
        - 'world_nether'
      permissions: false
      default_locale: 'en_US'
      locales: [en_US]
    
    groups:
      users:
        regen:
          # rate in seconds that the user regenerates health (0 for disabled)
          rate: 3
          # amount in health (2 health = 1 heart) per regeneration tick
          amount: 2
        disabled_commands:
          - 'warp'
        events:
          # these values will influence the amount of health upon certain events
          # the values may be modified freely, but don't exceed 20 or enter 0
          # currently, only _respawn works.
          # TODO:
          #   _damage: floor damage inflicted to the amount specified in this config
          # _damage: 0 (god mode?)
          _respawn: 1
        items:
          # any value specified after a material name will cause the player to gain health after using it
          # you could even specify "stone" or "obsidian" to heal players
          # values specified here will override default game values
          # If you specify a block (stone, obsidian, etc), the block will be consumed until the player's health is full
          # at which point the block will be placeable normally again
          # negative values can be given
          pork: 3
          grilled_pork: 6
      admins:
        regen:
          rate: 1
          amount: 1
        disabled_commands:
        events:
          _respawn: 20
        items:
          pork: 10
          grilled_pork: 20
    
    
    
    It just stops regenerating the health. I don't know how else to explain it. I'll get attacked by a mob, right after the first hit it'll start regenerating, but any subsequent hits (at all), it won't regenerate. I am using GroupManager, do I need to add the two permissions to the groups?
     
  14. Offline

    krinsdeath

    With permissions: false, it should default to users being normal users and ops being admins (and shouldn't ask for permissions at all). I haven't yet tested this plugin (I am currently rewriting one of my others) on CB1000, but after doing this I did notice a few inconsistencies, which I will be addressing in my next version. I should be done with it later tonight, so if you're still on I suggest you check back in a bit. Sorry for the inconvenience.

    note: Your config file looks fine, so I don't know why it wouldn't work properly. As I said before, I am working on it.

    @JukeboxJohnny - Updated to 0.3.0 (see first post). I built it against CB1000, and everything worked fine. If you encounter any issues, be sure to post here. If there are errors, include your system.log and config.yml. Thanks!
     
  15. Offline

    JukeboxJohnny

    I'm not sure if it's because I forgot that my world is named differently or because of the update you pushed, but so far it's working good. Thanks. :D
     
  16. Offline

    maxexcloo

    I seem to be getting this error endlessly:
    Code:
    21:16:43 [SEVERE] Could not pass event PLAYER_INTERACT to SimpleHealth
    java.lang.NullPointerException
            at net.krinsoft.simplehealth.PListener.onPlayerInteract(PListener.java:29)
            at org.bukkit.plugin.java.JavaPluginLoader$10.execute(JavaPluginLoader.java:307)
            at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:58)
            at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:332)
            at org.bukkit.craftbukkit.event.CraftEventFactory.callPlayerInteractEvent(CraftEventFactory.java:168)
            at net.minecraft.server.ItemInWorldManager.interact(ItemInWorldManager.java:210)
            at net.minecraft.server.NetServerHandler.a(NetServerHandler.java:553)
            at net.minecraft.server.Packet15Place.a(SourceFile:57)
            at net.minecraft.server.NetworkManager.b(NetworkManager.java:226)
            at net.minecraft.server.NetServerHandler.a(NetServerHandler.java:85)
            at net.minecraft.server.NetworkListenThread.a(SourceFile:105)
            at net.minecraft.server.MinecraftServer.h(MinecraftServer.java:451)
            at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:361)
            at net.minecraft.server.ThreadServerApplication.run(SourceFile:422)
    
    I'm on RB1000, Permissions 3.1.6 and here is my config:
    Code:
    groups:
        players:
            regen:
                amount: 1
                rate: 20
            disabled_commands:
            events:
                _respawn: 20
            items:
        administrators:
            regen:
                amount: 2
                rate: 20
            disabled_commands:
            events:
                _respawn: 20
            items:
    
    plugin:
        default_locale: 'en'
        locales: [en]
        peaceful: false
        peaceful_worlds:
        permissions: true
    
     
  17. Offline

    krinsdeath

    @maxexcloo - That was just a dumb mistake on my part. Fixed it, and the jar is updated. Just redownload the static jar above.

    Also, I'm assuming you changed the file to en.yml for the localization? Otherwise it won't work properly.

    the commit
     
  18. Offline

    maxexcloo

    It seems to work!
    Awesome job on the update speed :eek:
     
  19. Offline

    JukeboxJohnny

    Back again. I've been getting this error occasionally:
    Code:
    10:35:40 [SEVERE] java.util.ConcurrentModificationException
    10:35:40 [SEVERE]       at java.util.AbstractList$Itr.checkForComodification(AbstractList.java:372)
    10:35:40 [SEVERE]       at java.util.AbstractList$Itr.next(AbstractList.java:343)
    10:35:40 [SEVERE]       at org.bukkit.craftbukkit.CraftWorld.getPlayers(CraftWorld.java:551)
    10:35:40 [SEVERE]       at net.krinsoft.simplehealth.SimpleTimer.regenerate(SimpleTimer.java:24)
    10:35:40 [SEVERE]       at net.krinsoft.simplehealth.SimpleTimer.run(SimpleTimer.java:17)
    10:35:40 [SEVERE]       at org.bukkit.craftbukkit.scheduler.CraftWorker.run(CraftWorker.java:34)
    10:35:40 [SEVERE]       at java.lang.Thread.run(Thread.java:662)
    
    Config if need:
    Show Spoiler
    Code:
    # If you're using permissions, the default configuration nodes are 'simplehealth.users' and 'simplehealth.admins'
    # You can specify as many groups in this file as you want, and include them in permissions with 'simplehealth.[groupname]'
    # If you're not using permissions, the default group names of 'users' and 'admins' can't be changed (it will throw errors if you change them)
    plugin:
      # If your server uses peaceful mode, and you don't want users to regen super fast
      # set peaceful to true
      peaceful: false
      peaceful_worlds:
        - 'World1'
        - 'world1_nether'
      permissions: false
      default_locale: 'en_US'
      locales: [en_US]
    
    groups:
      users:
        regen:
          # rate in seconds that the user regenerates health (0 for disabled)
          rate: 3
          # amount in health (2 health = 1 heart) per regeneration tick
          amount: 2
        disabled_commands:
          - ''
        events:
          # these values will influence the amount of health upon certain events
          # the values may be modified freely, but don't exceed 20 or enter 0
          # currently, only _respawn works.
          # TODO:
          #   _damage: floor damage inflicted to the amount specified in this config
          # _damage: 0 (god mode?)
          _respawn: 1
        items:
          # any value specified after a material name will cause the player to gain health after using it
          # you could even specify "stone" or "obsidian" to heal players
          # values specified here will override default game values
          # If you specify a block (stone, obsidian, etc), the block will be consumed until the player's health is full
          # at which point the block will be placeable normally again
          # negative values can be given
          pork: 3
          grilled_pork: 6
      admins:
        regen:
          rate: 1
          amount: 1
        disabled_commands:
        events:
          _respawn: 20
        items:
          pork: 10
          grilled_pork: 20
    



    Anymore information needed, let me know.

    Also would it be possible to disable pvp on a specific world? If so, could that be added like:
    #pvp enabled or disabled?
    pvp_worlds:
    - 'World1'
    - 'world1_nether'

    That would be most excellent. :D
     
  20. Offline

    krinsdeath

    This is a result of the low settings "rates" for your users and admins groups. I haven't really figured out how to prevent this at super low health regen rates, so you might just have to live with the error for now (or increase the regen rates from 1-3 to about 5-10, and increase the regen amount to match)

    As for the pvp thing, I suppose I could add it. Along with any bugs I find and fix, I'll try to bundle it into the next release.
     
  21. Offline

    Switch0r

    Is this bad?
    18:34:56 [SEVERE] Could not pass event PLAYER_RESPAWN to SimpleHealth
    java.lang.NullPointerException
    at net.krinsoft.simplehealth.PListener.onPlayerRespawn(PListener.java:46
    )
    at org.bukkit.plugin.java.JavaPluginLoader$3.execute(JavaPluginLoader.ja
    va:258)
    at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.jav
    a:58)
    at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.j
    ava:338)
    at net.minecraft.server.ServerConfigurationManager.moveToWorld(ServerCon
    figurationManager.java:239)
    at net.minecraft.server.ServerConfigurationManager.moveToWorld(ServerCon
    figurationManager.java:204)
    at net.minecraft.server.NetServerHandler.a(NetServerHandler.java:870)
    at net.minecraft.server.Packet9Respawn.a(SourceFile:18)
    at net.minecraft.server.NetworkManager.b(NetworkManager.java:226)
    at net.minecraft.server.NetServerHandler.a(NetServerHandler.java:85)
    at net.minecraft.server.NetworkListenThread.a(SourceFile:105)
    at net.minecraft.server.MinecraftServer.h(MinecraftServer.java:451)
    at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:361)
    at net.minecraft.server.ThreadServerApplication.run(SourceFile:422)
     
  22. Offline

    krinsdeath

    @Switch0r - Fixed that error, was just lazy coding on my part. Version updated to 0.3.2!

    I have not yet added pvp world toggling, but it is on my todo list. I've got a lot of projects, and this is a relatively stable plugin, so it's on the back-burner. I'll get to it shortly, though!
     
  23. Offline

    Switch0r

    Thanks for the fast fix. :)
    But now it disabled mywarp plugin , i fixed it by removing a line in simplehealth config:
    disabled_commands:
    #- 'warp'
     
  24. Offline

    krinsdeath

    Alright! Version 0.3.3 is done (I think). I did some pretty big remodeling to the classes [the commit], so I'm not 100% sure it'll work out. If all explodes in hellfire, you can just roll back to v0.3.2. I did test it to make sure it wasn't bug filled, so it should be decently stable.

    I recommend backing up your configs, and then deleting the config files to receive the updated ones. I changed a few of the keys to make everything less ambiguous.

    As for the concurrency issues, I believe I fixed them by creating scheduler tasks for each player individually (only as long as they need to regenerate), so there shouldn't be multiple plugins editing the same player now.

    As always, feedback and bug reports~ Ciao.
     
  25. Offline

    Switch0r

    This plugin runs very good only i see some errors in the log :p
    2011-07-30 08:05:24 [INFO] [HeroicDeath] dkjaa took a leap of faith
    2011-07-30 08:05:24 [SEVERE] java.lang.IllegalArgumentException: Health must be between 0 and 200
    2011-07-30 08:05:24 [SEVERE] at org.bukkit.craftbukkit.entity.CraftLivingEntity.setHealth(CraftLivingEntity.java:38)
    2011-07-30 08:05:24 [SEVERE] at net.krinsoft.simplehealth.SimpleTimer.regenerate(SimpleTimer.java:65)
    2011-07-30 08:05:24 [SEVERE] at net.krinsoft.simplehealth.SimpleTimer.run(SimpleTimer.java:17)
    2011-07-30 08:05:24 [SEVERE] at org.bukkit.craftbukkit.scheduler.CraftWorker.run(CraftWorker.java:34)
    2011-07-30 08:05:24 [SEVERE] at java.lang.Thread.run(Unknown Source)
    2011-07-29 23:14:47 [SEVERE] java.util.ConcurrentModificationException
    2011-07-29 23:14:47 [SEVERE] at java.util.AbstractList$Itr.checkForComodification(Unknown Source)
    2011-07-29 23:14:47 [SEVERE] at java.util.AbstractList$Itr.next(Unknown Source)
    2011-07-29 23:14:47 [SEVERE] at org.bukkit.craftbukkit.CraftWorld.getPlayers(CraftWorld.java:555)
    2011-07-29 23:14:47 [SEVERE] at net.krinsoft.simplehealth.SimpleTimer.regenerate(SimpleTimer.java:24)
    2011-07-29 23:14:47 [SEVERE] at net.krinsoft.simplehealth.SimpleTimer.run(SimpleTimer.java:17)
    2011-07-29 23:14:47 [SEVERE] at org.bukkit.craftbukkit.scheduler.CraftWorker.run(CraftWorker.java:34)
    2011-07-29 23:14:47 [SEVERE] at java.lang.Thread.run(Unknown Source)
     
  26. Offline

    krinsdeath

    @Switch0r - That is.. a weird error. There is nothing on any of the lines mentioned in that stack trace.

    Are you up to date? I recommend downloading 0.3.3 :x

    source for SimpleTimer.java
     
  27. Offline

    Switch0r

    Ok updated to 3.3 :)
     
  28. Offline

    McMicGera

    Am I doing it wrong? I have got the newest Permissions version and my groupnames are "default" and "admins" but no regeneration happens ingame. Do you have a hint for me, please?
    Here's my config.
    Code:
    # If you're using permissions, the default configuration nodes are 'simplehealth.users' and 'simplehealth.admins'
    # You can specify as many groups in this file as you want, and include them in permissions with 'simplehealth.[groupname]'
    # If you're not using permissions, the default group names of 'users' and 'admins' can't be changed (it will throw errors if you change them)
    plugin:
      # Any worlds specified here will have regeneration applied to them. Worlds not specified will remain unaffected.
      worlds:
        - 'world'
        - 'world_nether'
      # If your server uses peaceful mode, and you don't want users to regen super fast
      # Any worlds specified here will have no natural health regeneration
      # This will negate the fast regen effect of peaceful servers
      natural_regen:
        - 'world'
        - 'world_nether'
      # Any worlds specified here will have blocked PVP combat.
      pvp:
        - 'world_nether'
      permissions: true
      default_locale: 'en_US'
      locales: [en_US]
    
    groups:
      default:
        regen:
          # rate in seconds that the user regenerates health (0 for disabled)
          rate: 30
          # amount in health (2 health = 1 heart) per regeneration tick
          amount: 1
        disabled_commands:
          # '*' will match all commands
          - 'warp'
        events:
          # these values will influence the amount of health upon certain events
          # the values may be modified freely, but don't exceed 20 or enter 0
          # currently, only _respawn works.
          # TODO:
          #   _damage: floor damage inflicted to the amount specified in this config
          # _damage: 0 (god mode?)
          _respawn: 10
        items:
          # any value specified after a material name will cause the player to gain health after using it
          # you could even specify "stone" or "obsidian" to heal players
          # values specified here will override default game values
          # If you specify a block (stone, obsidian, etc), the block will be consumed until the player's health is full
          # at which point the block will be placeable normally again
          # negative values can be given
          pork: 3
          grilled_pork: 6
      admins:
        regen:
          rate: 30
          amount: 1
        disabled_commands:
        events:
          _respawn: 10
        items:
          pork: 3
          grilled_pork: 6
     
  29. Offline

    krinsdeath

    Did you add the permissions 'simplehealth.default' and 'simplehealth.admins' to their relevant groups in PermissionsBukkit's config.yml?

    If so, can I get a look at your config.yml to confirm you're doing it properly? There doesn't appear to be anything wrong with your config.

    edit: If you have custom world names, you need to change the world names in the "worlds" list to reflect them, otherwise my plugin will not apply health regeneration in those worlds.
     
  30. Offline

    Woolcity

    Would you ever be able to make it so you could --- Limit health to a certain amount withing only a specified WorldGuard region?
     

Share This Page