[MECH] Hungry v0.3.1 - Yet another hunger plugin [1060]

Discussion in 'Inactive/Unsupported Plugins' started by tr4656, Jun 14, 2011.

  1. Offline

    tr4656

    [​IMG]

    Hungry
    Authors: jonathanyc and tr4656
    Version: v0.3.1

    Hungry adds immersion to Minecraft! There is a reason to actually eat food in order to survive making it more realistic - so gather your food and actually eat so you won’t go hungry.

    Highlights:
    • There is actually a need to eat food (like real life)
    • Custom Language support
    Resources:
    Download Plugin
    Contribute at Bitbucket!
    Github Mirror

    Instructions, Permissions and FAQ:
    Our wiki is hosted at Bitbucket, and is available here.
    Quick Links
    To-do list and Known Bugs:
    See our Bitbucket issues page.

    Changelog:
    v0.3.1
    • Fixed eating events not registering when right-clicking on air.
    Credits:
    • Thanks to Fullwall, for his Gastronomic plugin (off which many parts of this plugin were based!)
    • Thanks to chernobyl360, for maintaining Gastronomic after Fullwall stopped (until he got hacked)
     
  2. Offline

    jonathanyc

    I present to you, the most tedious update to make (ever!)

    Version 0.2
    • Added support for custom languages, defined in config.json!
    • Added support for custom hunger-level notification messages, defined in config.json!
    • Added support for custom message prefixes! (Change [Hungry], or remove it altogether!)
    What's left for another release in v0.2... (i.e. after I get some sleep)
    • Add a custom message to show players when they eat food
    What's slated for v0.3...
    • Effects!
    Available, once again, at http://icebrg.us/dl/Hungry.jar

    Updating to v0.2

    You'll want to add the following lines to your config.json file, or no one will see any messages!
    Code:
      "messagePrefix": "§e[Hungry] ",
      "messages": {
        "MSG_SAVECONFIG_SUCCESS": "§aConfiguration succesfully saved!",
        "MSG_STARVING": "§cYou are starving!",
        "VAR_FOOD_LIST_ITEM": "§a%s§e : §a%s",
        "ERR_INVALID_HUNGER_FORMAT": "§cInvalid format for player hunger!",
        "MSG_FOOD_LIST_END": "§a\u003d\u003d\u003d END EDIBLE FOODS \u003d\u003d\u003d",
        "VAR_CURRENT_HUNGER_IS": "§aYour current hunger level is §f%s",
        "ERR_SAVECONFIG_FAILURE": "§cConfiguration failed to save!",
        "MSG_TOGGLED_ENABLED": "§aHungry is now enabled!",
        "ERR_NO_SUCH_FOOD": "§cNo food with that name/id was found.",
        "MSG_TOGGLED_DISABLED": "§cHungry is now disabled!",
        "MSG_FOOD_LIST_START": "§a\u003d\u003d\u003d EDIBLE FOODS \u003d\u003d\u003d",
        "MSG_RELOAD_SUCCESS": "§aHungry succesfully reload!",
        "VAR_FOOD_INFO": "§f%s §a restores §f %s §a hunger.",
        "ERR_ONLY_USABLE_INGAME": "§cThis command can only be used by in-game players.",
        "ERR_RELOAD_FAILURE": "§cHungry failed to reload!",
        "VAR_SETHUNGER": "§aSuccesfully set§f %s\u0027s hunger to §f %s."
      },
      "hungerLevelNotifications": {
        "80": "Your stomach aches from hunger.",
        "20": "You feel a bit peckish.",
        "40": "Your stomach rumbles.",
        "60": "You start to feel hungry."
      }
    All the §cs and whatnot are color-codes, recognized by Minecraft for setting chat color.

    If you don't get something in the file, please ask me, I'll be glad to help tomorrow - going to sleep now. :p

    EDIT: One last thing. There is a grammatical error in the configuration file. :< "Hungry succesfully reload" should obviously be "Hungry successfully reloaded," etc. Also, you might encounter problems trying to edit the configuration file with encoding. I'll try to fix this. :(
     
  3. Offline

    Tealk

    can you add a value
    hunger-respawn=50
     
  4. Offline

    jonathanyc

    Alright. :D
     
  5. Offline

    Tealk

    thanks
    a second question i use this Jail Plugin how dos it work that jailed player dont get hungry?

    //Edit
    http://icebrg.us/dl/Hungry.jar
    this link i get 0.1.3

    //Edit2
    And please add it to CraftBukkitUpToDate

    is any explain to the values?
    eg:
    checkInterval; in seconds?
    incrementAmount; every interval become hungry?

    //Edit 3
    dont eat if you feed your dog
     
  6. Offline

    spunkiie

  7. Offline

    MisanthropX

    Thanks a lot to continue this, I think a lot of roleplaying Servers will appreciate your work, so do I!
    I am really looking forward to version 3.0 with custom effects.

    Any idea what it will be able to do? :)



    I like that, be sure to make a second variable if you died with hunger 100.
    Because many people just suicide to replenish the hunger because of hunger.
    But what if they die on 100? actually because of hunger and not of anything else.

    Another way would be to add a variable that asks to take over the hunger to my new life.

    keep-hunger-on-respawn: true

    thanks
     
  8. Offline

    spunkiie

  9. Offline

    tr4656

    I can try implementing the keep-hunger-on-respawn today. Thanks for the idea!
     
  10. Offline

    crazyball

    Got this error message :

    Any ideas ?
     
  11. Offline

    spunkiie

    Sad news :(

    It's still happening with 0.2.

    265 users online, about 40% of them have stalled hungry values :(
     
  12. Offline

    tr4656

    Done

    Thanks for the bug report. We will look into it.
     
  13. Offline

    TelephoneKiosk

    got this error message
     

    Attached Files:

  14. Offline

    Tealk

    perfekt
     
  15. Offline

    jonathanyc

    Do you have a hungerLevelNotifications section in your configuration file? If you don't, that might be the cause.

    Probably going to split up configuration files, so it's more apparent.
     
  16. Well, this doesn't seem to work for me, I get no messages whatsoever, I just downloaded it (v0.2) I have the messages in the config... also the config gets RESET when I start the server, what's up with that ?

    No errors, no output, commands obviously exist, they just refuse to work.
    I have '*' permission and tried commands in the server console aswell.
     
  17. Offline

    Spycoclown

    You forgot:
    Code:
    "100": "You are starving to death.",
    can i change the Messages and the level of hunger when the message comes?

    Im so excited for this update.
     
  18. The starving message is in the other list:
    EDIT: oh WOW... that's why it didn't work and re-wrote my config, I modified the levels in the hunger level notifications.
    You should make them changeable tough :p

    EDIT #2:
    On default config.
     
  19. Offline

    jonathanyc

    STOP! Appears to be an issue with the download! Don't download yet, please.
    Seem to have fixed link. Report if there are any problems. :)

    Actually, when you respawn, your hunger is set to defaultHunger if resetHungerAtRespawn is set to true. We need clearer documentation. :p

    They should be changeable now. :)

    Yep, hopefully all of the bugs will be out of the way so tr4656 and I can start on 0.3 :)

    Version 0.2.1
    • Seem to have fixed player hungers not incrementing (rewrote the loop to only look at online players instead of the more contorted way it was doing previously...)
    • Removed PLAYER_LOGIN listener (not necessary thanks to new method)
    • Fixed typoes in some configuration messages
    • @crazyball @TelephoneKiosk Fixed possible NullPointerException in HungryTimerTask when the player's hunger did not meet any hungerLevelNotifications
    • @Digi @Spycoclown Seem to have fixed hungerLevelNotifications not being changeable - deprecated MSG_STARVING to be just another hungerLevelNotification to be more consistent
    • Added hungerLevelNotificationsOnlyOnExact configuration property, if you only want players to be notified of their hunger level when it exactly matches a value in hungerLevelNotifications
    • Seem to have fixed configuration problem wherein the UTF-8 encoding process somehow got messed up, leading to a possibility of weird corrupted configuration files
    Known Bugs
    • Still looking for a way to fix right clicking on wolves restoring hunger
    Upgrading Configuration
    When you upgrade to v0.2.1, Hungry may not like your configuration file and it may rename it to config.json.bak. :) If this happens, you should do the following:
    • Check to make sure messages doesn't contain "MSG_STARVING" - this has been deprecated, we now just use hungerLevelNotifications
    • Check to make sure you have all of the new configuration keys (this time, only hungerLevelNotificationsOnlyOnExact)
    If you don't see any messages with Hungry when you try to use it, make sure you have the messages configuration property and that it has working values. :)

    The v0.2.1 configuration is available at https://bitbucket.org/jonathanyc/hungry/wiki/configuration, as usual. Ask for help if necessary! (we need to make an easier way to upgrade configurations...)

    Hopefully after we fix the bug with wolves and any other bugs that pop up we will be able to proceed to v0.3!

    Have fun with Hungry. :)

    Yeah, that was when I was updating the link. :)

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

    T4L_Goose

    ETA on the wolves fix? Anytime soon? Should I wait? I just don't want to get this plugin, just to have to reboot in an hour to get the next one, lol.
     
  21. Offline

    jonathanyc

    Haha, probably no more updates today unless something critical pops up. ;)
    We'll try to get the wolves fix in tomorrow.
     
  22. Offline

    TelephoneKiosk

    My hunger stopped increasing again :(
     
  23. Offline

    tr4656

    You are on 0.2.1?
     
  24. Offline

    TelephoneKiosk

    Yes.
     
  25. Offline

    jonathanyc

    !!
    Could you post a dump of your config.json file?
     
  26. Offline

    TelephoneKiosk

    {
    "isEnabled": true,
    "checkInterval": 14,
    "incrementAmount": 1,
    "defaultHunger": 0,
    "maxHunger": 100,
    "minHunger": 0,
    "canStockUpInfinitely": false,
    "starvationDamage": 2,
    "starvationDoesActualDamage": false,
    "resetHungerAtRespawn": true,
    "playerHungers": {
    "diveace": 7,
    "Armoral11": 6,
    "Troy2055": 1,
    "popman676": 1,
    "buzbi": 2,
    "ikeace": 7,
    "maddnes13": 7,
    "TelephoneKiosk": 6,
    "Dalagia": 4,
    "Footballuver28": 1,
    "Saddam_Hussein": 3,
    "NGAUGE": 7,
    "NetSend": 6,
    "DA_BIG_CHEWIE": 6
    },
    "foods": {
    "APPLE": 5,
    "PORK": 5,
    "MUSHROOM_SOUP": 20,
    "GOLDEN_APPLE": 100,
    "GRILLED_PORK": 15,
    "BREAD": 20,
    "COOKIE": 5,
    "RAW_FISH": 5,
    "COOKED_FISH": 15
    },
    "foodBlocks": {
    "CAKE_BLOCK": 8
    },
    "ignoreClickBlocks": [
    "DISPENSER",
    "NOTE_BLOCK",
    "BED_BLOCK",
    "CHEST",
    "WORKBENCH",
    "FURNACE",
    "BURNING_FURNACE",
    "WOODEN_DOOR",
    "LEVER",
    "IRON_DOOR_BLOCK",
    "STONE_BUTTON",
    "JUKEBOX",
    "LOCKED_CHEST",
    "TRAP_DOOR"
    ],
    "messagePrefix": "§e[Hungry] ",
    "messages": {
    "VAR_SETHUNGER": "§aSuccesfully set§f %s\u0027s §ahunger to§f %s.",
    "MSG_SAVECONFIG_SUCCESS": "§aConfiguration succesfully saved!",
    "ERR_NO_SUCH_FOOD": "§cNo food with that name/id was found.",
    "ERR_ONLY_USABLE_INGAME": "§cThis command can only be used by in-game players.",
    "MSG_TOGGLED_ENABLED": "§aHungry is now enabled!",
    "VAR_FOOD_INFO": "§f%s §a restores §f %s §a hunger.",
    "ERR_SAVECONFIG_FAILURE": "§cConfiguration failed to save!",
    "MSG_TOGGLED_DISABLED": "§cHungry is now disabled!",
    "MSG_FOOD_LIST_START": "§a\u003d\u003d\u003d EDIBLE FOODS \u003d\u003d\u003d",
    "VAR_CURRENT_HUNGER_IS": "§aYour current hunger level is §f%s",
    "MSG_FOOD_LIST_END": "§a\u003d\u003d\u003d END EDIBLE FOODS \u003d\u003d\u003d",
    "MSG_RELOAD_SUCCESS": "§aHungry succesfully reloaded!",
    "ERR_INVALID_HUNGER_FORMAT": "§cInvalid format for player hunger!",
    "ERR_RELOAD_FAILURE": "§cHungry failed to reloaded!",
    "VAR_FOOD_LIST_ITEM": "§a%s§e : §a%s"
    },
    "hungerLevelNotifications": {
    "100": "§cYou are starving!",
    "20": "You feel a bit peckish.",
    "80": "Your stomach aches from hunger.",
    "40": "Your stomach rumbles.",
    "60": "You start to feel hungry."
    },
    "hungerLevelNotificationsOnlyOnExact": true
    }
     
  27. Offline

    jonathanyc

    Alright - now who's hunger is not increasing? If a few people's isn't, then I think I might now. Otherwise, it's a new bug.
     
  28. Offline

    TelephoneKiosk

    For a few people it is, for others it isn't.
     
  29. Offline

    jonathanyc

    That's very strange. When did you download v0.2.1? Sorry for the many questions. :(
     
  30. Offline

    TelephoneKiosk

    1 hour and 33 minutes ago.
     
  31. Offline

    jonathanyc

    This is very strange indeed - it's working fine on the test server.
    I can't see what's wrong with your configuration - does Hungry throw any error messages?
    Have you tried deleting the configuration, then using /hungryreload to re-create the configuration?
    Perhaps not everyone has the hungry.player.hunger permission? (For that matter, what Permissions plugin are you using?)
    If after a lot of struggle we still can't find out why, I'll create a modified "verbose" version of Hungry for you to see what's wrong.
     

Share This Page