[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

    Plague

  3. Offline

    RazorFlint

    Cool! . I will test it now for bugs etc But Remember To ^^^^^^^^ :D
     
  4. Offline

    dak393

    Do you plan on adding permissions for this? Might want to give this to specific groups.
     
  5. Offline

    Sixael

    Wasn't planned but I'll take a look into Permissions. ;)

    I hope it's properly formatted now.
     
  6. Offline

    MrObject

    Wow, this is awesome. You should go work with Nossr to get it added into MCMMO. That would be really cool.
     
    lipe123 likes this.
  7. Offline

    Brian Clark

    Could just be me but when I tried to implement this on my server the server.log was flooded with "300" about 5 times a second for every user that logged in..

    Could very well be a conflict with another one of the many plugins I'm using, but i just thought I'd throw it out there!

    Also would love to see this implemented into mcmmo as well. Love this idea!
     
    lipe123 likes this.
  8. Offline

    overlordror

    Looking forward to trying this and I have to say, it might be something that could be incorporated into MCMMO if nossr was willing.
     
  9. Offline

    Sixael

    It was something I used to check where one of the bugs were coming from, removed now. ;)
     
  10. Offline

    kleril

    Cool plugin! Unfortunately, every time the /lungstats command is used, it gives the output along with 'Unknown console command. Type "help" for help.'

    Another thing you could add is the ability to configure how often a 'remaining lungpower' message shows up underwater. Eg. Every multiple of 5 seconds left, every 1 second , etc.
     
  11. Offline

    MeinerHosen

    I like how this looks:)

    It would be a great addition to mcMMO, but I would download it regardless:D
     
  12. Offline

    Esge

    exactly my thoughts
     
  13. Offline

    Sixael

    1. fixed.

    2. added.
     
  14. Offline

    kleril

    Weird. Whenever I try to unzip version 0.1.2 I get this: TrainYourLungv0.1.2.zip.cpgz
    When I unzip that I end up with the original zip file. :S
     
  15. Offline

    xZise

    Your zip is currupted:
    Code:
    Archive:  /home/xzise/Downloads/TrainYourLungv0.1.2.zip
    [/home/xzise/Downloads/TrainYourLungv0.1.2.zip]
      End-of-central-directory signature not found.  Either this file is not
      a zipfile, or it constitutes one disk of a multi-part archive.  In the
      latter case the central directory and zipfile comment will be found on
      the last disk(s) of this archive.
    zipinfo:  cannot find zipfile directory in one of /home/xzise/Downloads/TrainYourLungv0.1.2.zip or
              /home/xzise/Downloads/TrainYourLungv0.1.2.zip.zip, and cannot find /home/xzise/Downloads/TrainYourLungv0.1.2.zip.ZIP, period.
    Fabian
     
  16. Offline

    Sixael

    Upped a new version, should be unzipable again.^^'
     
  17. Offline

    Simanova

    Not working for #678 - any idea ? ( server.log is without errors )
    TrainYourLung ist not counting for players.
    Player cant level up in diving discipline :(

    playername.txt shows:
    using 0.13
     
  18. Offline

    Sixael

    still running 670, will try to reproduce the problem later.
    does the same happen with 0.1.1b?
     
  19. Offline

    Simanova

    678 + 0.11b = exactly same effect without error output in server.log

    playername.txt contains:
     
  20. Offline

    Sixael

    Updated to 677 (where did you get 678?) and runs fine, local and on my server.
    The standard value of the reminder is 5.0, your .txt file says 10.0 so it must've saved that, strange.
    I'm trying to find a solution, maybe an other database system...

    Anyone else having this problem?
     
  21. Offline

    Simanova

    Bukkit build overview http://ci.bukkit.org/job/dev-CraftBukkit/changes
    I was going to try out some different settings with /reminder x

    Can you add some debugging for 0.14 to increase transparency?
    Debugging should result into a textfile (.txt).

    More details for you:
    > Iam using Debian Squeeze with stable updates und SunJava environment.
    > Minecraft server start parameters are:
    Code:
    PARAMS="-Xmx4096M -Xms3072M -XX:+UseConcMarkSweepGC -XX:+CMSIncrementalPacing -XX:+AggressiveOpts -XX:parallelGCThreads=2 -jar"
    > In fact garbage collection und multithreaded java
    > All other plugins are working fine - Minecraft server runs stable 24/7
     
  22. Offline

    Sixael

    I will try to implement some sort of debugging mode and a better way to save the player data over the next days (could take me some time since I never programmed something like this before^^').
     
  23. Offline

    xZise

    Does my users need to have the permission to use it?

    And it is working nice here. But the 5 secs interval... I don't think it is accurate. And a little more highlighting would be nice.

    Fabian

    Okay, I added the permissions to a group and another player (with this permission) now test it and I get following error:
    Code:
    01:32:10 [SEVERE] Could not pass event PLAYER_MOVE to TrainYourLung
    java.lang.NullPointerException
            at bukkit.Sixael.TrainYourLung.TYLPlayerListener.onPlayerMove(TYLPlayerL
    istener.java:49)
            at org.bukkit.plugin.java.JavaPluginLoader$7.execute(JavaPluginLoader.ja
    va:240)
            at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:59)
            at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:255)
            at net.minecraft.server.NetServerHandler.a(NetServerHandler.java:128)
            at net.minecraft.server.Packet10Flying.a(SourceFile:126)
            at net.minecraft.server.NetworkManager.a(NetworkManager.java:198)
            at net.minecraft.server.NetServerHandler.a(NetServerHandler.java:72)
            at net.minecraft.server.NetworkListenThread.a(SourceFile:100)
            at net.minecraft.server.MinecraftServer.h(MinecraftServer.java:368)
            at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:283)
            at net.minecraft.server.ThreadServerApplication.run(SourceFile:375)
    Fabian

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

    Jonathan Bloom

    I also agree with the McMMO integration. :)

    I was getting spammed in the console with the error "Cannot pass event PlayerMove to TrainYourLungs". I had to disable this plugin. 677

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

    Sixael

    which version? 0.1.3b with/without permissions?
     
  26. Offline

    Jonathan Bloom

    0.1.3b with permissions
     
  27. Offline

    Sixael

    I will take permissions out until I find the error, will be uploaded in a second
     
  28. Offline

    Jonathan Bloom

    Code:
    2011-04-16 16:20:48 [INFO] TYL: jonathanblooms file found.
    2011-04-16 16:20:48 [SEVERE] java.lang.NumberFormatException: null
    2011-04-16 16:20:48 [SEVERE] at java.lang.Integer.parseInt(Integer.java:417)
    2011-04-16 16:20:48 [SEVERE] at java.lang.Integer.parseInt(Integer.java:499)
    2011-04-16 16:20:48 [SEVERE] at bukkit.Sixael.TrainYourLung.TrainYourLung.loadLungData(TrainYourLung.java:99)
    2011-04-16 16:20:48 [SEVERE] at bukkit.Sixael.TrainYourLung.TYLPlayerListener.onPlayerMove(TYLPlayerListener.java:49)
    2011-04-16 16:20:48 [SEVERE] at org.bukkit.plugin.java.JavaPluginLoader$7.execute(JavaPluginLoader.java:240)
    2011-04-16 16:20:48 [SEVERE] at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:59)
    2011-04-16 16:20:48 [SEVERE] at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:255)
    2011-04-16 16:20:48 [SEVERE] at net.minecraft.server.NetServerHandler.a(NetServerHandler.java:128)
    2011-04-16 16:20:48 [SEVERE] at net.minecraft.server.Packet10Flying.a(SourceFile:126)
    2011-04-16 16:20:48 [SEVERE] at net.minecraft.server.NetworkManager.a(NetworkManager.java:198)
    2011-04-16 16:20:48 [SEVERE] at net.minecraft.server.NetServerHandler.a(NetServerHandler.java:72)
    2011-04-16 16:20:48 [SEVERE] at net.minecraft.server.NetworkListenThread.a(SourceFile:100)
    2011-04-16 16:20:48 [SEVERE] at net.minecraft.server.MinecraftServer.h(MinecraftServer.java:368)
    2011-04-16 16:20:48 [SEVERE] at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:283)
    2011-04-16 16:20:48 [SEVERE] at net.minecraft.server.ThreadServerApplication.run(SourceFile:375)
     
  29. Offline

    Sixael

    Sorry, packed the wrong .jar. Upped the right one now.^^'
     
  30. Offline

    Jonathan Bloom

    Still getting this:
    2011-04-16 16:43:35 [SEVERE] Could not pass event PLAYER_MOVE to TrainYourLung
     

Share This Page