[MECH] TrainYourLung v1.0 - Add some realism to diving [1337]

Discussion in 'Inactive/Unsupported Plugins' started by Sixael, Apr 13, 2011.

  1. Offline

    Sixael

    TrainYourLung - Leveling system for diving.
    Version: 1.0 - Download in attachment (external below description)

    This plugin is made for people who like to play and host their server the "non-cheaty" but more favorable way than vanilla.

    Description/Features:
    So what does it do?
    It adds a leveling-mechanism to diving, so whenever you go out of bubbles under water the so called "LungPower" gives the player a boost of air. The amount of air the player gets depends on how often he uses it. Every time you use some of your LungPower it has to recover (by not being under water, 1 second equals 1 recovered point). While recovering you gain for every LungPower point an experience point. When the experience-points reach a certain value you gain one more point to your max. LungPower. One point equals 0.05 sec more time to dive. The higher the max. LungPower, the longer it takes to gain a level up.
    <Edit by Moderator: Redacted mediafire url>

    Commands:

    Show Spoiler
    /lungstats
    shows the person using the command how much LungPower is remaining, his current EXP and the EXP needed to level up.

    /reminder <value>
    sets the plugin to inform you every multiple of the value. value of 1 equals 1 second.

    /maxlungair <playername> <value> or /mla <playername> <value>
    changes the maximum lungair of the player to the value. value of 1 equals 0.05 seconds.

    /remaininglungair <playername> <value> or /rla <playername> <value>
    changes the remaining lungair of the player to the value. value of 1 equals 0.05 seconds.
    /rates
    shows the current plugin rates.
    /pointsperlevelup <value>
    changes the points per levelup. value of 1 equals 0.05 seconds.

    /regenerationrate <value>
    changes regeneration rate of your lungair (faster regeneration rate = faster leveling). value of 1 equals 1 ms.




    Permissions:

    Show Spoiler
    "trainyourlung.lungpower" to have access to the plugin itself.
    "trainyourlung.command.maxlungair" access to maxlungair command.
    "trainyourlung.command.remaininglungair" access to remaininglungair command.
    "trainyourlung.command.pointsperlevelup" access to poinstperlevelup command.
    "trainyourlung.command.regenerationrate" access to regenerationrate command.



    Changelog:

    Show Spoiler
    v.1.0: fixed a lot of stuff, updated to newest bukkit version.
    v.0.1.5c: plugin config is being saved every time the commands are used.
    v.0.1.5b: fixed plugin saving function.
    v.0.1.5: added configurable plugin rates (points per levelup and regeneration rate for now).
    v.0.1.4a: refactoring, added new commands (maxlungair and remininglungair) and permissions for them.
    v.0.1.4: fixed reload commands breaking the plugin and improved the code.
    - known bug: plugin not working right if dove to long (unsure if fixed in 0.1.4a).
    v.0.1.3f: fixed the problem on player quit (hopefully)
    - known bug: reloading the plugin breaks it. (fixed)
    v.0.1.3e: readded permissions.
    v.0.1.3d: fixed and changed saving function, hopefully fixed nullpointer problem.
    v.0.1.3c: fixed remaining air resetting when dying in water.
    - known bug: nullpointer problem still occurs. (fixed)
    v.0.1.3b: fixed reminder, hopefully fixed the use of permissions causing a nullpointer exception.
    v.0.1.3: added Permissions support (requested by dak393)
    - known bug: reminder acting weird sometimes, atm looking into it...
    v.0.1.2: removed the 'unknown command' output and added a configurable reminder (requested by kleril)
    v.0.1.1b: removed the "300" console output.
    v.0.1.1: some refactoring and bugfixing here and there.
    v0.1: release.


    Download:
     

    Attached Files:

    Last edited by a moderator: Dec 14, 2016
    Aaron_Merric likes this.
  2. Offline

    Sixael

    lol yea, misspelled the save part.^^
    new version up in a few seconds.
     
  3. Offline

    KaosXi

    Awesome thanks
     
  4. I have 1.5b and the Plugin.cfg resets everytime the server is restarted.
    Is this fixed already or do I have to change it in-game?
    Or do I have to create a new file?
     
  5. Offline

    Sixael

    Should have worked, as long as the server was stopped properly.
    Changed that in 0.1.5c.
     
  6. Oh it was my mistake. I didn't know I had to change it in-game! Sorry!
    Nether the less.. I wish I could set how much exp it needs each level. And can you please explain the regeneration rate? does it mean x ms it regenerates 0.01s?
     
  7. Offline

    Sixael

    0.05s. ;)
     
  8. Offline

    Xordaii

    Running bukkit 860 (for now, will probably upgrade after this weekend) and tried to run commands for the first time, leveling up works, and actually training your lungs to stay under longer. But trying to use /mla and /rla got null pointer exceptions and "Internal error occurred" while trying to execute the command in chat.

    From server logs:
    Show Spoiler

    Code:
    2011-06-24 23:13:42 [SEVERE] null
    org.bukkit.command.CommandException: Unhandled exception executing command 'mla' in plugin TrainYourLung v0.1.5b
        at org.bukkit.command.PluginCommand.execute(PluginCommand.java:37)
        at org.bukkit.command.SimpleCommandMap.dispatch(SimpleCommandMap.java:128)
        at org.bukkit.craftbukkit.CraftServer.dispatchCommand(CraftServer.java:287)
        at net.minecraft.server.NetServerHandler.handleCommand(NetServerHandler.java:714)
        at net.minecraft.server.NetServerHandler.chat(NetServerHandler.java:680)
        at net.minecraft.server.NetServerHandler.a(NetServerHandler.java:673)
        at net.minecraft.server.Packet3Chat.a(Packet3Chat.java:32)
        at net.minecraft.server.NetworkManager.b(NetworkManager.java:223)
        at net.minecraft.server.NetServerHandler.a(NetServerHandler.java:75)
        at net.minecraft.server.NetworkListenThread.a(SourceFile:105)
        at net.minecraft.server.MinecraftServer.h(MinecraftServer.java:399)
        at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:309)
        at net.minecraft.server.ThreadServerApplication.run(SourceFile:422)
    Caused by: java.lang.NullPointerException
        at bukkit.Sixael.TrainYourLung.TrainYourLung.onCommand(TrainYourLung.java:316)
        at org.bukkit.command.PluginCommand.execute(PluginCommand.java:35)
        ... 12 more
    2011-06-24 23:13:59 [SEVERE] null
    org.bukkit.command.CommandException: Unhandled exception executing command 'rla' in plugin TrainYourLung v0.1.5b
        at org.bukkit.command.PluginCommand.execute(PluginCommand.java:37)
        at org.bukkit.command.SimpleCommandMap.dispatch(SimpleCommandMap.java:128)
        at org.bukkit.craftbukkit.CraftServer.dispatchCommand(CraftServer.java:287)
        at net.minecraft.server.NetServerHandler.handleCommand(NetServerHandler.java:714)
        at net.minecraft.server.NetServerHandler.chat(NetServerHandler.java:680)
        at net.minecraft.server.NetServerHandler.a(NetServerHandler.java:673)
        at net.minecraft.server.Packet3Chat.a(Packet3Chat.java:32)
        at net.minecraft.server.NetworkManager.b(NetworkManager.java:223)
        at net.minecraft.server.NetServerHandler.a(NetServerHandler.java:75)
        at net.minecraft.server.NetworkListenThread.a(SourceFile:105)
        at net.minecraft.server.MinecraftServer.h(MinecraftServer.java:399)
        at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:309)
        at net.minecraft.server.ThreadServerApplication.run(SourceFile:422)
    Caused by: java.lang.NullPointerException
        at bukkit.Sixael.TrainYourLung.TrainYourLung.onCommand(TrainYourLung.java:344)
        at org.bukkit.command.PluginCommand.execute(PluginCommand.java:35)
        ... 12 more
     
  9. Offline

    Sixael

    Did you use it correctly?
    For example: /rla Sixael 300.
     
  10. Offline

    xZise

    Your plugin seems to be having problems, when it couldn't read/write the file. Because of this, my stats are often reseting, which is very annoying then to recover the stats each time.

    Fabian
     
  11. Offline

    Xordaii

    yes, I did. I tried /mla first with 3000 and with 500. Then I tried /rla Xordaii 416 (/lungstats told me 416 is my current max.) Still same errors no matter how large or small a number I use.

    This isn't a case of not using the correct syntax, and if it is, it is bad error handling. A program should catch a poorly written command and tell the user how to write it properly, which this program did do. I first tried /mla 500 and got proper syntax help. It was after using the correct syntax that I got the errors.
     
  12. Offline

    Aaron_Merric

    It appears that this plugin is broken as of bukkit 953 and minecraft 1.7.2. I have noticed that the player files do not retain the players lung stats after restarts most of the time. Loved this plugin hope someone fixes it or the original developer comes back.
     
  13. Offline

    Sixael

    Sorry, I've been busy lately and hadn't much time to do coding.
    I'll take a look at the latest changes of bukkit and hopefully be able to release a new version in the next few days. ;)
     
  14. Offline

    Sixael

    New version is up.
    Please report bugs in time so I'll be able to fix it before friday. ;)
     
  15. Offline

    G1R Productions

    Could I get just a .jar download not zipped or anything please?
     
  16. Offline

    compgurusteve

    :confused: all Operating systems come with a .zip utility.
     
  17. Offline

    bradgillap

    18.07 17:32:18 [Server] SEVERE Could not pass event PLAYER_QUIT to TrainYourLung
     
  18. Offline

    Simanova

  19. Offline

    compgurusteve

  20. Offline

    poiNt_3D

    Training does not work. It's always 15 seconds.
     
  21. Offline

    Xordaii

    @Sixael , is it possible to get this compatible for PermissionsBukkit in the future? No hurries, just would like to add this back to the server.
     
  22. Offline

    Sixael

    Of course it's possible, but since the plugin isn't working right atm and I'm having some serious A level shit going on there'll be a lack of spare time for me the next weeks...
     
  23. Offline

    Xordaii

    Thanks for the heads up :) It isn't a critical plugin, just one of those "nice to have, especially when building underwater." We can do without until you can get to it. Good luck with school.
     
  24. its working perfect under 1060.. so you can update your title:) and again, great work..
     
  25. Offline

    Simanova

    confirmed
     
  26. and its still working under 1337:) you can update your title
     
  27. Offline

    DaddyCool64

    Don't work with RB1597 for me
     

Share This Page