[FUN] Gills v3.1 - let players breathe underwater [1000]

Discussion in 'Inactive/Unsupported Plugins' started by Hretsam, Apr 18, 2011.

  1. Offline

    Hretsam

    Gills - Let players breathe underwater
    Version: v3.1

    This plugin stated simple, but it has been improved a lot.
    Same as the previous versions, Gills allows you to make sets of items that make players able to stay under water for a longer period of time.
    So you can make it so that a pumpkin can act like scuba gear, needing slimeballs 'store' the air. You can make any combination you like, it also knows the difference between orange and black wool.

    If your just interested in the water related damage you can simply remove the itemsets and that will stop them from working.
    Gills got permissions support, but its not needed. You can also set it to all users or just ops.
    Also Gills will fire the EntityDamageEvent when a player gets damage from Gills.
    Below you can find how to catch the event, and how you can see what damage has been done.x

    Biome damage:
    "The freezing winds are not kind for the brave miner, as he the ground crumbles he falls into the freezing sea.
    His body starts to hurt as he gets deeper into the abyssal plain.
    The minor realizes that if he doesn't get to shore soon, he will not be able to leave the sea."

    Biome damage is done when a player enters the water in a cold biome, the biomes that are considered cold are: ICE_DESERT, TUNDRA & TAIGA.
    You can make some itemsets reduce the amount of damage taken, as the player gets deeper into the water, the damage will also increase.

    Lava damage:
    "When the miner enters the water spring to refresh himself, he feels the heat the nearby magma is providing.
    But as he feels he is getting dragged by the water, he notices he is getting closer to the source of the heat.
    The temprature of the water starts to skyrocket.
    The miner uses the last of his energy to out the water fast before its to late."

    The player will get lava damage when he/she is in the water to close to a lava source (the range is adjustable). The water will get to 'hot' for the player and he will start taking damage.

    Coreheat damage:
    "After days of digging trough the rough stone and hordes of monsters, the miner is getting closer to the center of the world.
    As he find himself stuck above the unbreakable stones that seem to protect the center, he creates a little pool to refresh himself.
    But as he enters the water, he find that its getting hotter by the second. Good think he found out early, otherwise the miner would have a lot more problems."

    The idea behind coreheat damage, is that the core of the world (the void) is hot. So any water that is close to it should be warmed up. Players will receive damage when in water to close to the void.


    If you got some feature you want added, reply below and i will see what i can do.
    I want to thank Lunarius Haberdash for his suggestions, and the rest for the support.x

    Features:
    • Breathe underwater
    • Set usage of items, in return for air
    • Added possibility for Wetsuit, water breathing helmet (idea for RP server?)
    • Fully customizable
    • Permissions support
    • Possible to reload config file runtime (by server, or with permissions)
    • Clean config file on first startup
    • Adjustable depth & altitude
    • Biome, lava, coreheat water-damage
    • Combined itemsets (With items that are consumed & conserved)
    • Force armour wear (making the user to wear the armour in the itemset)
    • World blacklist (define in what world it shouldn't work)
    • Adjustable altitude (only works on given altitude)
    • Consumed empty buckets will be replace with a water bucket!
    Download file here. (version 3.1)

    Source code (GitHub, fork it!)

    Default config file, if you want it:
    config.yml (v3) (open)
    Code:
    ---
    ## Version of the config file, do not touch
    configversion: 3
    
    ## Permissions node:
    ## These can be used with or without the permissions plugin
    ## set to something you like (for example 'gills.admin') to make use it in Permissions
    ## set it to 'x' to disable the node
    ## set it to 'all' to make the node available to all users
    ## set it to 'op' to make the node available to op's
    
    permission:
      ## Permissions node, this allows the user to reload the config file.
      admin node: gills.admin
      ## Permissions node, this allows the user to use gills
      user node: gills.user
      ## Permissions node, this allows the user to stay underwater forever (without itemsets)
      unlimited node: gills.unlimited
      ## No biome damage, this will prevent the user of being damaged in the water.
      no damage node: gills.noDamage
    
    ## Does damage if your in the water, and comply with one of these settings
    damage:
      ## The time between each damage event, in miliseconds
      ## If you set this to a very low value, it can kill the player very fast.
      interval: 1000
    
      ## Biome related damge
      ## This is damage dont in 'cold' biomes
      ## Biomes that are considerd cold are: ICE_DESERT, TUNDRA & TAIGA
      biome:
        enable: false
        ## Multiplyer for depth. Basedamage = Depth * multiplyer
        ## Depth = amount of water blocks above the player
        depth multiplyer: 1.1
    
      ## Lava related damage
      ## This damage is applied when there is a lava source near the player
      lava:
        enable: false
        ## The radius of the warming effects of lava
        radius: 4
        ## Damage the lava will do
        basedamage: 3
    
      ## CoreHeat related damage
      ## This damage is applied if the player is close to the void.
      coreheat:
        enable: false
        ## The last layer that is considerd 'close to the core'.
        till layer: 10
        ## Damage the coreheat will do
        basedamage: 3
    
    ## Sets of items which you need to stay underwater, can be multiple
    itemsets:
      ## This name doesn't matter as long its unique
      ## This set will require you to wear full leather armour, and have 2 slimballs for each air refill.
      set1:
        ## The consumed items needed for this itemset to work
        items:
          ## Like slimeballs
          consume:
            ## Slimeballs
            - 341
            ## Slimeballs
          ## The conserved items needed for this itemset to work
          ## Like armour
          conserve:
            ## Leather Helmet
            - 298
            ## Leather Chestplate
            - 299
            ## Leather Leggins
            - 300
            ## Leather Boots
            - 301
        ## permission node, see discription above
        node: all
        ## Set this to true, if any armour items must be worn to make it work!
        armour must be worn: true
        ## Damage reduction for damage types
        damage reduction:
          ## This overrides the above biome damage, if set to 100 or higher no damage is done.
          biome: 50
          ## This overrides the above lava damage, if set to 100 or higher no damage is done.
          lava: 20
          ## This overrides the above coreheat damage, if set to 100 or higher no damage is done.
          coreheat: 25
    
        conditions:
          ## The depth where this itemset will work.
          ## 0 = any, you can set range like (0-40)
          depth range: 0
          ## The altitude (from bedrock) where this itemset will work.
          ## 0 = any, you can set range like (0-40)
          altitude range: 0-10
          ## Blocklist of world where this itemset should not work
          worldBlacklist:
            - nether
    
      ## A set that allows the player to breathe with empty (air) buckets
      ## The empty bucket is not taken, but replace with a water bucket!
      set2:
        items:
          consume:
            ## Empty bucket
            - 325
    
        node: all
        conditions:
          depth range: 0-5
          altitude range: 0
    
    ...
    
    Example code for GillsDamageEvent (open)
    Code:
        @Override
         public void onEntityDamage(EntityDamageEvent event) {
             if (event.isCancelled()){
                 return;
             }
    
             // Check if its a gills damage event
             if (event instanceof GillsDamageEvent){
                 // Create the gills damaga event
                 GillsDamageEvent gevent = (GillsDamageEvent) event;
                 // Switch between the damage types
                 switch (gevent.getGillsDamageType()){
                     case BIOME_DAMAGE:
                         // Biome damage
                         break;
                     case COREHEAT_DAMAGE:
                         // Coreheat damage;
                         break;
                     case LAVA_DAMAGE:
                         // Lava damage;
                         break;
                 }
             }
         }

    Changelog:

    Version 3.1:
    • Old config files will be renamed (added .old behind it
    • itemsets can now include items that are consumed or conservered
    • You can set that armour must be worn to take effect
    • Added biome damage (damage the player in cold biomes)
    • Added lava damage (damage the player if near lava source)
    • Added coreheat damage (damage the player if near the center of the World)
    • Added itemsets world blacklist (disable on these worlds)
    • Added set altitude (so you can set that it only works on a couple of layers)
    • Fixed bug where it would crash if itemsets are empty
    • Revised access to config variables
    • Added Intrange to store variables like depth & altitude.
    Version 3.0:
    • Updated to 3.0!
    • Updated for 1.7.3 (DinnerBone's build)
    • Fixed bug where items not taken
    • Fixed bug where items not calculated correctly
    • Changed config file, to make it more clear
    • Fixed bug where bubbles are not updated
    • Added possibility to limit it to a certain depth
    • Fixed permissions for server without the Permissions plugin
    • Fixed bug with error message on shutdown
    Version 2.3:
    • Update to 766
    Older versions (open)
    Version 2.2:
    • Fixed bugs when using items
    • Fixed bug with everyone can use Gills
    • Fixed bug where items where not taken
    • Updated to 733
    • Updated config file, and added uptodate check
    • Added to CraftBukkitUpToDate
    Version 2.1:
    • Update to 703, but added some bugs
    Version 2.0:
    • Added config
    • Added permission support
    • Added item usage
    • Uploaded source to githut
    Version 1.0:
    • Initial Release
     
    Xordaii and seiji_kun like this.
  2. Offline

    Anreill

    Having a problem with this.

    If I set the unlimited node to all in the Gills config, it works correctly. If I set user node to all and configure an item set, it doesn't work.

    My config is basically the one in the first post except for a few changes to items and the obvious changes to who can use it.
    Code:
    ## Version of the config file, do not touch
    configversion: 3
    
    ## Permissions node:
    ## These can be used with or without the permissions plugin
    ## set to something you like (for example 'gills.admin') to make use it in Permissions
    ## set it to 'x' to disable the node
    ## set it to 'all' to make the node available to all users
    ## set it to 'op' to make the node available to op's
    
    permission:
      ## Permissions node, this allows the user to reload the config file.
      admin node: op
      ## Permissions node, this allows the user to use gills
      user node: all
      ## Permissions node, this allows the user to stay underwater forever (without itemsets)
      unlimited node: x
      ## No biome damage, this will prevent the user of being damaged in the water.
      no damage node: gills.noDamage
    
    ## Does damage if your in the water, and comply with one of these settings
    damage:
      ## The time between each damage event, in miliseconds
      ## If you set this to a very low value, it can kill the player very fast.
      interval: 1000
    
      ## Biome related damge
      ## This is damage dont in 'cold' biomes
      ## Biomes that are considerd cold are: ICE_DESERT, TUNDRA & TAIGA
      biome:
        enable: false
        ## Multiplyer for depth. Basedamage = Depth * multiplyer
        ## Depth = amount of water blocks above the player
        depth multiplyer: 1.1
    
      ## Lava related damage
      ## This damage is applied when there is a lava source near the player
      lava:
        enable: false
        ## The radius of the warming effects of lava
        radius: 4
        ## Damage the lava will do
        basedamage: 3
    
      ## CoreHeat related damage
      ## This damage is applied if the player is close to the void.
      coreheat:
        enable: false
        ## The last layer that is considerd 'close to the core'.
        till layer: 10
        ## Damage the coreheat will do
        basedamage: 3
    
    ## Sets of items which you need to stay underwater, can be multiple
    itemsets:
      ## This name doesn't matter as long its unique
      ## This set will require you to wear full leather armour, and have 2 slimballs for each air refill.
      divingoutfit:
       ## The consumed items needed for this itemset to work
        items:
          consume:
            ## Leaves
            - 18
          conserve:
            ## Golden Helmet
            - 314
            ## Leather Chestplate
            - 299
            ## Leather Leggins
            - 300
            ## Iron Boots
            - 309
        ## permission node, see discription above
        node: all
        ## Set this to true, if any armour items must be worn to make it work!
        armour must be worn: true
        ## Damage reduction for damage types
       damage reduction:
          ## This overrides the above biome damage, if set to 100 or higher no damage is done.
          biome: 50
          ## This overrides the above lava damage, if set to 100 or higher no damage is done.
          lava: 20
          ## This overrides the above coreheat damage, if set to 100 or higher no damage is done.
          coreheat: 25
    
        conditions:
          ## The depth where this itemset will work.
          ## 0 = any, you can set range like (0-40)
          depth range: 0
          ## The altitude (from bedrock) where this itemset will work.
          ## 0 = any, you can set range like (0-40)
          altitude range: 0-10
          ## Blocklist of world where this itemset should not work
          worldBlacklist:
            - nether
      ## A set that allows the player to breathe with empty (air) buckets
      ## The empty bucket is not taken, but replace with a water bucket!
      set2:
        items:
          consume:
            ## Empty bucket
            - 325
    
        node: all
        conditions:
          depth range: 0-5
          altitude range: 0
     
    
     
  3. Offline

    Hretsam

    I think the issue is the altitude range, its currently set to 0 - 10. That means the itemset can only be used from layers 0 - 10 (from bedrock up).
    To make it work everywhere set altitude range to 0 (altitude range: 0) .
     
  4. Offline

    Xordaii

    I am having something similar to Anreill's problem, but I can't get it to do either the unlimited or the itemset.

    I have an itemset that just requires slimeballs. I checked, and set the altitude range to 0. It doesn't seem to matter what I set up, I can't get the plugin to work.

    I am both an OP and an admin on the server.
    Show Spoiler

    Code:
    ## Version of the config file, do not touch
    configversion: 3
    
    ## Permissions node:
    permission:
      ## Permissions node, this allows the user to reload the config file.
      admin node: gills.admin
      ## Permissions node, this allows the user to use gills
      user node: gills.user
      ## Permissions node, this allows the user to stay underwater forever (without itemsets)
      unlimited node: gills.unlimited
      ## No biome damage, this will prevent the user of being damaged in the water.
      no damage node: gills.noDamage
    
    ## Does damage if your in the water, and comply with one of these settings
    damage:
      ## The time between each damage event, in miliseconds
      ## If you set this to a very low value, it can kill the player very fast.
      interval: 1500
    
      ## Biome related damge
      ## This is damage done in 'cold' biomes
      ## Biomes that are considerd cold are: ICE_DESERT, TUNDRA & TAIGA
      biome:
        enable: false
        ## Multiplier for depth. Basedamage = Depth * multiplier
        ## Depth = amount of water blocks above the player
        depth multiplyer: 1.1
    
      ## Lava related damage
      ## This damage is applied when there is a lava source near the player
      lava:
        enable: false
        ## The radius of the warming effects of lava
        radius: 4
        ## Damage the lava will do
        basedamage: 3
    
      ## CoreHeat related damage
      ## This damage is applied if the player is close to the void.
      coreheat:
        enable: false
        ## The last layer that is considerd 'close to the core'.
        till layer: 10
        ## Damage the coreheat will do
        basedamage: 3
    
    ## Sets of items which you need to stay underwater, can be multiple
    itemsets:
      ## This name doesn't matter as long its unique
      ## This set will require you to wear full leather armour, and have 2 slimballs for each air refill.
      slime:
        ## The consumed items needed for this itemset to work
        items:
          ## Like slimeballs
          consume:
            ## Slimeballs
            - 341
            ## Slimeballs
          ## The conserved items needed for this itemset to work
          ## Like armour
          conserve:
            ## Leather Helmet
            #- 298
            ## Leather Chestplate
            #- 299
            ## Leather Leggins
            #- 300
            ## Leather Boots
            #- 301
        ## permission node, see discription above
        node: all
        ## Set this to true, if any armour items must be worn to make it work!
        armour must be worn: false
        ## Damage reduction for damage types
        damage reduction:
          ## This overrides the above biome damage, if set to 100 or higher no damage is done.
          biome: 50
          ## This overrides the above lava damage, if set to 100 or higher no damage is done.
          lava: 20
          ## This overrides the above coreheat damage, if set to 100 or higher no damage is done.
          coreheat: 25
        conditions:
          ## The depth where this itemset will work.
          ## 0 = any, you can set range like (0-40)
          depth range: 0
          ## The altitude (from bedrock) where this itemset will work.
          ## 0 = any, you can set range like (0-40)
          altitude range: 0
          ## Blocklist of world where this itemset should not work
          worldBlacklist:
          #  - nether
    
      ## A set that allows the player to breathe with empty (air) buckets
      #set2:
        #items:
          #consume:
            ## Empty bucket
            #- 325
        #node: all
        #conditions:
          #depth range: 0-5
          #altitude range: 0
    ...

    Running PermissionsBukkit, RB 1060 if that helps.
     
  5. Offline

    mrvertigo27

    I had a similar issue, check your world blacklist make sure your world ADN permissions support this. also since superperms isnt supported you may have to use the special superperms bridge depending on your setup.

    also @Hretsam any chance of an update for superperms and 1060?
     
  6. Offline

    Xordaii

    Already using the bridge. The rest of that isn't very clear. How did you fix it, and what do you mean does the world support it? I don't see how it could be turned off by a world, really. Unless you set the permissions on a per world basis, which I haven't.
     
  7. Offline

    Hretsam

    Remove the items that are in the 'converse' section.
    Its currently in your config so that you need to have a slimball and full leather armour.


    It should be working on build #1060.
    But i will test it soon, and add support for the Dinnerperms/Superperms.
     
  8. Offline

    Xordaii

    # doesn't comment out the leather armor? I was pretty sure I had it commented out.
     
  9. Offline

    Hretsam

    Your right, you said you where and Admin yourself.
    Try setting the user node to 'all'
     
  10. Offline

    Opterongeek

    Can anyone tell me if this works for 1.8 bukkit with PermissionsEX? Really getting tired of the door trick ;)
     

Share This Page