Solved Hunger Keeper

Discussion in 'Plugin Help/Development/Requests' started by madtomic, Mar 13, 2015.

Thread Status:
Not open for further replies.
  1. Offline

    madtomic

    Plugin name: Hunger Keeper

    Can someone please update this plugin to support UUID or recode a similar plugin. Basically, I need a simple plugin that keeps your players hunger after they die, this will force player to eat food rather than to just kill themselves to gain hunger.

    This applies on player death events, force quit, client crash, etc. So they can't cheat in any form.

    An outdated example is Hunger Keeper
    http://dev.bukkit.org/bukkit-plugins/hunger-keeper/

    Thanks,
    madtomic

    I just found out it is already storing in UUID.

    But players can crash client and restored to more hearts. It still need works!

    <Edit by mrCookieSlime: Merged posts. Please don't double post. There is an Edit Button right next to the Date.>
     
    Last edited by a moderator: Mar 15, 2015
  2. Offline

    pie_flavor

    Last edited: Mar 13, 2015
  3. Offline

    madtomic

    How does it store the player data now?

    Can you bukkit/spigot this?

    Can you github or bucket this so the source available for review?

    I know it's a simple plugin.

    Thanks for quick response.
     
  4. Offline

    pie_flavor

    @madtomic It's Java 1.6, so you can just decompile it, but I'll put the source here. I'm not about to go through DBO or whatever Spigot has (i don't actually know) for something this simple.

    And yes, it stores it by UUID, but I don't actually save it so the hunger's lost on server restart
     
  5. Offline

    madtomic

    @pie_flavor

    Thank you for getting back.

    Do you think you can add so it would save hungers in a file so they aren't lost on server restart? This does everything better than Hunger Keeper except the hungers aren't saved.

    madtomic
     
  6. Offline

    pie_flavor

  7. Offline

    madtomic

    Awesome! I'll be waiting for the update.
     
  8. Offline

    pie_flavor

    @madtomic Done. Click the original link for the update. This will save the current status of everyone when the server shuts down, when someone dies, and when someone respawns.
     
  9. Offline

    madtomic

    Can you update the pastebin with the updated codes?

    I reload the plugin and it created the config.yml

    I think on first load, it just give error.

    http://pastebin.com/3j6MY3PC

    Thanks. :)
     
  10. Offline

    pie_flavor

    @madtomic I didn't put a config.yml in my jar, I didn't think I needed one cause it was just gonna be blank. Weird, the javadocs says that it'll just create an empty one. Oh well. Download from the first link for an update.

    I mean seriously.
     
  11. Offline

    madtomic

    I did some more internal testings. I only noticed the config.yml only update or add entries on player death events.

    On server /stop, it does not.
    On server crashes, it does not.
    On player join, it does not.
    On player quit, it does not.

    Would it be possible to add in a update on an interval? Like every 5 minutes? or 6000 ticks.?

    Can you look into this. Thanks.
     
  12. Offline

    pie_flavor

    @madtomic It's supposed to save on /stop and /reload. It's not possible to save on crash.
    Either way, every time someone dies or respawns it's updated. I don't see the issue here because when else would you need it updated?
     
  13. Offline

    madtomic

    On Stop and reload it didn't saved. I tested with 3 other accounts just now. No entries were made for the new players whom just joined.

    Crash is hard because memory is lost.
     
  14. Offline

    pie_flavor

    @madtomic When the player dies, the config is updated. When the player respawns, the config is updated. What would need to be updated between the time the player respawns and the server shuts down, or between the time the player dies and the server shuts down?
     
  15. Offline

    madtomic

    I think, I'm confused on the server stop and reload hunger saved. I forgot there is also the default save in playerdata in world folder. This is also saved on server stop and reload. I forgot your plugin overrides when player dies and respawn which vanilla does not. I will play a bit more and see the behavior and perhaps I can better understand when hunger save should occurs. Thank you again for your work on this.
     
  16. Offline

    pie_flavor

    @madtomic No, you got it right. All the data is saved in the config. I don't understand why it's not saving on reload or stop. But all the data is saved when something in the game is changed, so a save on stop/reload isn't necessary.
     
  17. Offline

    madtomic

    Ok, that's what I thought when I was checking the changes. Please let me know if you figured it out. Thanks
     
Thread Status:
Not open for further replies.

Share This Page