[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

    Windwaker

    DISREGARD THIS
     
  3. Offline

    NEO

    Permissions would be nice :) Perhaps a configurable helmet that you need to wear for gills to take effect? Maybe a cooldown so players cant stay underwater forever, or the ability to specify an item that players need to use to regain more air underwater.
     
  4. Offline

    Hretsam

    Good idea, i will add it.
     
  5. I dont like the configurable helmet part but permissions would be nice. Can you make the helmet make a option since that is already a plugin?
     
  6. Offline

    Archelaus

    Please review the sticky at the top pertaining to title formatting and title formatting. The body of this thread and the title is wrong.
     
  7. Offline

    Hretsam

    Better?
    If not, can you say what is wrong?
     
  8. Might be nice if they had to consume an item, like sugarcane or a bucket of air (that would then fill with water).
     
  9. Offline

    Hretsam

    Good idea of the bucket, i like that.
     
  10. Offline

    RobotGymnast


    Could it be optional, though? I personally like just the regular ol' breathe underwater.
    Also, once you're an "official" plugin, can you get yourself submitted to CraftBukkitUpToDate?
     
  11. Offline

    Hretsam

    Yes i will make sure you can configure everything, so its possible to leave it as it is.
    as for the craftbukkituptodate, i'll try
     
  12. Offline

    S@M

    it would be nice to have the possibilty to attenuate the water filter and if you want to make it a complete underwater kit, a wet suit with which you could mine at the regular speed and fins with which you could move at the regular speed underwater would be nice.
     
  13. Offline

    Taemera

    Could you include the version number in the title? I'm waiting for the Permissions update and so whenever it's updated I'll see it in the titel :D.
     
  14. Offline

    Hretsam

    Updated to V2.1

    Hmm, wierd bug in removing items. Could be the 705 build?
    Will fix it in the morning
    I cant test it against older builds..

    Please test it out if you can, and report the results here. (due add the build number)

    Thank you
     
  15. Offline

    Plague

    Don't use a plus sign in the version tag. If you really need to use more versions, use [X-Y] or [X,Y].
     
  16. Offline

    Samylots

    Hum... when i give the node '' gills.unlimited '' to ONE group and put the '' use item to breath '' to FALSE, all groups can breath o.o i tried to disable to each groups without the group it nedd this, but it don't work !

    Help me pls !

    ho sorry ... i corrected this ! thanks you

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

    Hretsam

    Updated to 2.2,

    Should fix the bugs.
    Except for the air bubble update, cant seem to find it. I think its client side.
     
  18. Offline

    ioScream

    Cool, an alternative to a plugin i wanted to use, but the author did a few things weird and refused to budge. I'll have to give this one a try.
     
  19. Offline

    SpaceTime

    what are the commands for this plugin?
     
  20. Offline

    TheMan217

    How do u make the wetsuit??
     
  21. Offline

    Hretsam

    There are none

    Add the items for the wetsuit by id
    set "use items" on true
    set "needall" on true
    and set "consume items" on false
     
  22. Offline

    hedgomatic

    I too am confused by the helmet / wetsuit option. I'd like to set jack-o-lanterns as the helmet, but the yml doesn't seem to specify a setting?
     
  23. Offline

    Hretsam

    Try this config file:

    Code:
    ## Version of the config file, do not touch
    configversion: 1
    ## The player needs items to breathe underwater, if false unlimited underwater time
    useitems: true
    ## The player needs all items to breathe underwater
    needall: true
    ## Items need to be consumed after useage
    consume items: false
    
    ## Permissions nodes: set to 'null' if not used
    ## Permissions node, this allows the user to reload the config file. (if set to null, only server can)
    admin node: gills.admin
    ## Permissions node, this allows the user to use gills (if set to null, everyone can)
    user node: gills.user
    ## Permissions node, this allows the user to stay underwater forever (without items)
    unlimited node: gills.unlimited
    
    ## the items needed to stay underwater (can be several)
    items:
        #Pumpkin
        - 86
    
     
  24. Offline

    Moon_werewolf

    This mod don't work at at for me. i get the message that i start

    But i still take damage
     
  25. Offline

    neoneoz

    could you tell me how to use this plugin?im new to plugins and putting this .jar file into my plugins folder in my bukkit sever folder does not seem to do anything.
     
  26. Offline

    Kalexer

    Plugin lets me breath forever, but I have useitems on true, here's my config:
    Code:
    configversion: 1
    useitems: true
    needall: false
    consume items: true
    
    items:
        #Sugar Cane
        - 338
    
     
  27. Offline

    Ghil

    I have the same problem as Kalexer, it's kind of perplexing :p
     
  28. Offline

    Unstable_Flight

    I'm getting the same thing too! Here's my config:

    Code:
    ## Version of the config file, do not touch
    configversion: 1
    ## The player needs items to breathe underwater, if false unlimited underwater time
    useitems: true
    ## The player needs all items to breathe underwater
    needall: true
    ## Items need to be consumed after useage
    consume items: true
    
    ## Permissions nodes: set to 'null' if not used
    ## Permissions node, this allows the user to reload the config file. (if set to null, only server can)
    admin node: gills.admin
    ## Permissions node, this allows the user to use gills (if set to null, everyone can)
    user node: gills.user
    ## Permissions node, this allows the user to stay underwater forever (without items)
    unlimited node: gills.unlimited
    
    ## the items needed to stay underwater (can be several)
    items:
        #Leather Helmet
        - 298
    The only permissions node I have on is 'gills.user'
     
  29. Offline

    Hretsam

    Do you guys have the latest build of Craftbukkit?

    Updated, should work. if the problem continues. Please write down your config file
    I just noticed you have needall to true. This is not working together with consume items. When i find some time i'll add it.

    Btw sorry for the late answer, been busy with a lot of stuff.

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

    Ghil

    It's alright I fixed mine, was a problem with a custom thing of mine that interfered :p
     

Share This Page