[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

    JonasD

    @jonathanyc Thanks :) :)

    But it doesnt work :( When u eat sth, nothing happens.. And theres no bread in config.
     
  3. Offline

    Pomme72

    I tried to use the new version. I have installed it, then I restart my server. I type in the chat : /hunger, then I have this awful shit in my console :O

    Code:
    ePluginManager.java:332)
    14:11:07 [SEVERE] at org.bukkit.craftbukkit.event.CraftEventFactory.callPl
    ayerInteractEvent(CraftEventFactory.java:168)
    14:11:07 [SEVERE] at net.minecraft.server.ItemInWorldManager.interact(Item
    InWorldManager.java:210)
    14:11:07 [SEVERE] at net.minecraft.server.NetServerHandler.a(NetServerHand
    ler.java:553)
    14:11:07 [SEVERE] at net.minecraft.server.Packet15Place.a(SourceFile:57)
    14:11:07 [SEVERE] at net.minecraft.server.NetworkManager.b(NetworkManager.
    java:226)
    14:11:07 [SEVERE] at net.minecraft.server.NetServerHandler.a(NetServerHand
    ler.java:85)
    14:11:07 [SEVERE] at net.minecraft.server.NetworkListenThread.a(SourceFile
    :105)
    14:11:07 [SEVERE] at net.minecraft.server.MinecraftServer.h(MinecraftServe
    r.java:451)
    14:11:07 [SEVERE] at net.minecraft.server.MinecraftServer.run(MinecraftSer
    ver.java:361)
    14:11:07 [SEVERE] at net.minecraft.server.ThreadServerApplication.run(Sour
    ceFile:422)
    14:11:09 [INFO] Loaded world: taliboa_nether
    14:11:23 [WARNING] cgdb tried to fly!
    14:11:29 [SEVERE] java.lang.NoSuchMethodException: com.nijikokun.bukkit.Permissi
    ons.Permissions.has(org.bukkit.entity.Player, java.lang.String)
    14:11:29 [SEVERE] at java.lang.Class.getMethod(Class.java:1605)
    14:11:29 [SEVERE] at us.icebrg.permissionscompat.PermissionsFacade.has(Per
    missionsFacade.java:21)
    14:11:29 [SEVERE] at us.icebrg.permissionscompat.PermissionsHandler.has(Pe
    rmissionsHandler.java:38)
    14:11:29 [SEVERE] at us.icebrg.hungry.HungryTimerTask._handlePlayer(Hungry
    TimerTask.java:106)
    14:11:29 [SEVERE] at us.icebrg.hungry.HungryTimerTask.run(HungryTimerTask.
    java:30)
    14:11:29 [SEVERE] at java.util.TimerThread.mainLoop(Timer.java:512)
    14:11:29 [SEVERE] at java.util.TimerThread.run(Timer.java:462)
    14:11:29 [SEVERE] java.lang.NoSuchMethodException: com.nijikokun.bukkit.Permissi
    ons.Permissions.has(org.bukkit.entity.Player, java.lang.String)
    14:11:29 [SEVERE] at java.lang.Class.getMethod(Class.java:1605)
    14:11:29 [SEVERE] at us.icebrg.permissionscompat.PermissionsFacade.has(Per
    missionsFacade.java:21)
    14:11:29 [SEVERE] at us.icebrg.permissionscompat.PermissionsHandler.has(Pe
    rmissionsHandler.java:38)
    14:11:29 [SEVERE] at us.icebrg.hungry.HungryTimerTask._handlePlayer(Hungry
    TimerTask.java:106)
    14:11:29 [SEVERE] at us.icebrg.hungry.HungryTimerTask.run(HungryTimerTask.
    java:30)
    14:11:29 [SEVERE] at java.util.TimerThread.mainLoop(Timer.java:512)
    14:11:29 [SEVERE] at java.util.TimerThread.run(Timer.java:462)
    14:11:29 [SEVERE] java.lang.NoSuchMethodException: com.nijikokun.bukkit.Permissi
    ons.Permissions.has(org.bukkit.entity.Player, java.lang.String)
    14:11:29 [SEVERE] at java.lang.Class.getMethod(Class.java:1605)
    14:11:29 [SEVERE] at us.icebrg.permissionscompat.PermissionsFacade.has(Per
    missionsFacade.java:21)
    14:11:29 [SEVERE] at us.icebrg.permissionscompat.PermissionsHandler.has(Pe
    rmissionsHandler.java:38)
    14:11:29 [SEVERE] at us.icebrg.hungry.HungryTimerTask._handlePlayer(Hungry
    TimerTask.java:106)
    14:11:29 [SEVERE] at us.icebrg.hungry.HungryTimerTask.run(HungryTimerTask.
    java:30)
    14:11:29 [SEVERE] at java.util.TimerThread.mainLoop(Timer.java:512)
    14:11:29 [SEVERE] at java.util.TimerThread.run(Timer.java:462)
    14:11:29 [SEVERE] java.lang.NoSuchMethodException: com.nijikokun.bukkit.Permissi
    ons.Permissions.has(org.bukkit.entity.Player, java.lang.String)
    14:11:29 [SEVERE] at java.lang.Class.getMethod(Class.java:1605)
    14:11:29 [SEVERE] at us.icebrg.permissionscompat.PermissionsFacade.has(Per
    missionsFacade.java:21)
    14:11:29 [SEVERE] at us.icebrg.permissionscompat.PermissionsHandler.has(Pe
    rmissionsHandler.java:38)
    14:11:29 [SEVERE] at us.icebrg.hungry.HungryTimerTask._handlePlayer(Hungry
    TimerTask.java:106)
    14:11:29 [SEVERE] at us.icebrg.hungry.HungryTimerTask.run(HungryTimerTask.
    java:30)
    14:11:29 [SEVERE] at java.util.TimerThread.mainLoop(Timer.java:512)
    14:11:29 [SEVERE] at java.util.TimerThread.run(Timer.java:462)
    14:11:29 [SEVERE] java.lang.NoSuchMethodException: com.nijikokun.bukkit.Permissi
    ons.Permissions.has(org.bukkit.entity.Player, java.lang.String)
    14:11:29 [SEVERE] at java.lang.Class.getMethod(Class.java:1605)
    14:11:29 [SEVERE] at us.icebrg.permissionscompat.PermissionsFacade.has(Per
    missionsFacade.java:21)
    14:11:29 [SEVERE] at us.icebrg.permissionscompat.PermissionsHandler.has(Pe
    rmissionsHandler.java:38)
    14:11:29 [SEVERE] at us.icebrg.hungry.HungryTimerTask._handlePlayer(Hungry
    TimerTask.java:106)
    14:11:29 [SEVERE] at us.icebrg.hungry.HungryTimerTask.run(HungryTimerTask.
    java:30)
    14:11:29 [SEVERE] at java.util.TimerThread.mainLoop(Timer.java:512)
    14:11:29 [SEVERE] at java.util.TimerThread.run(Timer.java:462)
    14:11:29 [SEVERE] java.lang.NoSuchMethodException: com.nijikokun.bukkit.Permissi
    ons.Permissions.has(org.bukkit.entity.Player, java.lang.String)
    14:11:29 [SEVERE] at java.lang.Class.getMethod(Class.java:1605)
    14:11:29 [SEVERE] at us.icebrg.permissionscompat.PermissionsFacade.has(Per
    missionsFacade.java:21)
    14:11:29 [SEVERE] at us.icebrg.permissionscompat.PermissionsHandler.has(Pe
    rmissionsHandler.java:38)
    14:11:29 [SEVERE] at us.icebrg.hungry.HungryTimerTask._handlePlayer(Hungry
    TimerTask.java:106)
    14:11:29 [SEVERE] at us.icebrg.hungry.HungryTimerTask.run(HungryTimerTask.
    java:30)
    14:11:29 [SEVERE] at java.util.TimerThread.mainLoop(Timer.java:512)
    14:11:29 [SEVERE] at java.util.TimerThread.run(Timer.java:462)
    Help ! ^^
     
  4. Offline

    jonathanyc

    Have you given yourself the proper permissions? You can add bread yourself.

    Ah, it appears that because of the (quite frankly) dumb way "Permissions" works, I would have to recode an entire chunk of code just to accommodate it. That ain't going to happen, seeing as apparently no one has any interest in this plugin and as I have to work on other stuff and because Bukkit's default permissions are now available, so consider Permissions unsupported. If you use the PermissionsEx plugin or the default Permissions plugin, it should work...
     
  5. Offline

    JonasD

    But I can't edit the config file :( The server resets it automaticly..
     
  6. Offline

    jonathanyc

    Have you tried using the /hungryreload command instead of the /reload command?

    Does the server make a .bak file? If so, the configuration file is corrupt.
     
  7. Offline

    axebyte

    Or update the file manullay and upload it while server is down, Occasionally i have a few plugins that will writ over an update to a config file. Shutting server off for 5 secs to transfer then restart, i have never had ne overwrite.
     
  8. Offline

    JonasD

    Can u add bread in hunger? Because it do not work :( thanks
     
  9. Offline

    Pomme72

    Oh noooooo, I need this plugin T_T

    I don't understand, I'm just using Permissions :confused: why isn't it compatible ? (sorry I'm french :p)
     
  10. Offline

    sagethor

    Apologies to adding to the plethora of complaints and questions... but here goes.

    PermissionsBukkit won't work with this plugin, having had an earlier version, I could use hunger while my players could not, even with the "hungry.player.hunger" and "hunger.player.hunger.check" permissions.

    In updating, nobody had access to these commands, even though those two permissions were given to all players. I'm running PermissionsBukkit along with SuperPermissions. Any ideas as to why this could happen? Thanks.
     
  11. Offline

    jonathanyc

    Strange - alright, I'll try to get in compatibility with Permissions and PermissionsBukkit.
     
  12. There is a built-in permissions system, but I think a lot of people will continue to use Permissions since only a few plugins support BukkitPermissions.
     
  13. Offline

    sagethor

    Yep, I've just downgraded to Permissions 3.1.5 and so far everything works perfectly. Except for this plugin, of course.
     
  14. Offline

    jonathanyc

    Uploaded a version which should fix compatibility with the default Bukkit permissions...

    You know the PermissionsBukkit plugin has a bridge that lets plugins that work with Permissions 3.0 work with it, right?

    @sagethor @Arno00 @Pomme72

    Just added a fix which may or may not fix support for Permissions... Test and see!

    (Also, whoever it was that donated, thanks very much! :)

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

    Pomme72

    OMG DUDE, Thank you ! I gonna test it right now, and if it's work, I'll make a donation <3

    EDIT : Didn't work, error with permissions again :(
     
  16. Offline

    jonathanyc

    Just uploaded another fix (I think I see what was wrong) - if it doesn't work this time, could you post the error?

    Thanks! :)

    EDIT: Just tested the fix on my test server - it seems to work! :D
     
  17. Offline

    Schlumpf

    Is there a Version which work on CB #1000 and Permissions 3.16?
    This Plugin is nice it would be great if someone will develop it -.-
     
  18. Offline

    Pomme72

    Yeah :D good game dude I <3 u, now it's working fine with Permissions, but a problem persist...

    The config.json always return to the default configuration when I do /reloadall, /hungryreload or when I totally restart the server.

    Help please :'( I need to modify the amount of hunger restored by eating apple and all ! :p
     
  19. Offline

    sagethor

    @Pomme72

    Shutdown your server, then edit the file. Believe me, there's a lot of people who don't know to do this. I managed to figure out by myself, but hey, it's always handy when editing any server files. ;)
     
  20. Offline

    Schlumpf

    Which Version is working? The official one or the one from jonathanyl with Poison?
     
  21. Offline

    Pomme72

    I already did this, but I retried today just for you :p same result :'( didn't work, config.json always come to the default configuration.

    Really, reallyyyyyy need help :'(

    EDIT : This is my console right now :)

    Code:
    19:11:00 [INFO] [Hungry] Loading configuration...
    19:11:00 [INFO] [Hungry] Loading configuration file...
    19:11:00 [SEVERE] [Hungry] Configuration file corrupt or invalid!
    19:11:00 [SEVERE] [Hungry] Moving old configuration file to config.json.bak...
    19:11:00 [SEVERE] [Hungry] 'Loading' a new, default configuration file...
    Any idea ?
     
  22. Thanks for the update, it looks alright.

    here is my report :

    MAJOR BUG :
    "starvationDamage" AND "minHealthByStarvation" works exactly the same, it means that if i set :
    "starvationDamage": 0
    "minHealthByStarvation": 1
    My health will go traight forward to 1 health, but i won't die.
    If I invert those :
    "starvationDamage": 1
    "minHealthByStarvation": 0
    It does the EXACT same thing. (go straight forward to 1, and don't die)

    The only way to die, is to set them bot to 0, but you will get one shoted, and if you don't reset hunger at respawn, you'll keep dying and you can't do anything.

    Minor bug :
    When you click on a cake to eat, it restores your hunger level but it doesn't consume on part of the cake.
    Also, if you right click a cake with any food in hand, your hunger get restored for that food and it doesn't consumes it.

    Hop you fix that soon, for now i'll just disable cake.

    Also, if i set "starvationDoesActualDamage": false
    I don't get any damage (I don't understand this param though ...).
     
  23. Offline

    sagethor

    If you want, I could send you my config to replace it with yours. What do you want to change it to?
     
  24. Offline

    jonathanyc

    Notice in the OP: "Authors: jonathanyc and tr4656".
    Also notice that both download links point to the same site...

    (They are one and the same).

    Have you been skipping the recent posts? It is being developed, it does support Permissions 3.16, and it does work on CB 1000 (see the title, bro).

    Just uploaded a potential fix to the first bug. Checking out the second bug, but about the second behavior for the second bug - that seems expected to me. I have to prioritize item foods or block foods, and right now item foods are prioritized.

    EDIT: Just uploaded potential fixes for Hungry and PoisonEffect, which should fix the cake bug and the being poisoned multiple times bug (respectively).

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

    Silarn

    Can you give an example of what goes under
    "poisonousFoods": {},
    "healingFoods": {},
    in the PoisonEffect.json?

    Do I list food names? Numbers?
     
  26. Offline

    Matthewbri

    Hey! I've been using your mod and it's great. Do you think you could implement a drink and sleep system, too? Make it a general "basic needs" plugin?
     
  27. Offline

    Schlumpf

    Hi,
    oh sry havent saw it. Where I looked the last time there was CB #840
    K, nice. I will test it, if it work now :)
     
  28. Offline

    jonathanyc

    Oh, sorry. Should have added documentation...

    For both of them, use a format similar to the foods list in Hungry's configuration file - keys being food names, as defined in Bukkit's Material class, and values being doubles representing the percent chance a player should be poisoned by the given food.

    For example, to make raw pork poisonous with a 75% chance:

    "poisonousFoods": {
    "PORK", 0.75
    }

    Hope it helps!

    Alright. :) If it doesn't, report back (with the error message) and I'll try to help!

    Also, please don't download HungryDebug.jar anymore - it's outdated.

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

    Pomme72

    This is my config, you can see what I wanna change here :)

    Code:
    {
      "isEnabled": true,
      "checkInterval": 60,
      "incrementAmount": 1,
      "defaultHunger": 0,
      "maxHunger": 100,
      "minHunger": 0,
      "canStockUpInfinitely": false,
      "starvationDamage": 2,
      "starvationDoesActualDamage": false,
      "resetHungerAtRespawn": true,
      "playerHungers": {
        "pomme72": 10
      },
      "foods": {
        "APPLE": 3,
        "PORK": 5,
        "GOLDEN_APPLE": 1,
        "MUSHROOM_SOUP": 20,
        "GRILLED_PORK": 15,
        "COOKIE": 20,
        "BREAD": 20,
        "COOKED_FISH": 20,
        "RAW_FISH": 5
      },
      "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": {
        "MSG_SAVECONFIG_SUCCESS": "§aConfiguration succesfully saved!",
        "ERR_ONLY_USABLE_INGAME": "§cThis command can only be used by in-game players.",
        "VAR_FOOD_INFO": "§f%s §a restores §f %s §a hunger.",
        "MSG_RELOAD_SUCCESS": "§aHungry succesfully reloaded!",
        "MSG_FOOD_LIST_START": "§a\u003d\u003d\u003d EDIBLE FOODS \u003d\u003d\u003d",
        "VAR_SETHUNGER": "§aSuccesfully set§f %s\u0027s §ahunger to§f %s.",
        "ERR_RELOAD_FAILURE": "§cHungry failed to reloaded!",
        "ERR_INVALID_HUNGER_FORMAT": "§cInvalid format for player hunger!",
        "MSG_TOGGLED_DISABLED": "§cHungry is now disabled!",
        "VAR_FOOD_LIST_ITEM": "§a%s§e : §a%s",
        "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",
        "MSG_TOGGLED_ENABLED": "§aHungry is now enabled!",
        "ERR_NO_SUCH_FOOD": "§cNo food with that name/id was found.",
        "ERR_SAVECONFIG_FAILURE": "§cConfiguration failed to save!"
      },
      "hungerLevelNotifications": {
        "100": "§cVous mourrez de faim!",
        "80": "Votre estomac veut manger!",
        "20": "Vous avez un petit creux.",
        "40": "Votre estomac gargouille.",
        "60": "Vous commencez a avoir faim."
      },
      "hungerLevelNotificationsOnlyOnExact": false
    }
     
  30. Offline

    Schlumpf

    Ok, thanks :)
    Hmm it work! Just a bit laggy or maybe its normal idk. But my hunger is 2% and a Pork take 20 hunger. But I need to eat about 10 Porks till it reacts and change my hunger to 0% is that normal?
    Hmm now I ate 64 Porks and the hunger is still at 5% from 5%?
    Hmm a cake work. But when you eat a cake the cake is still there.
     
  31. Offline

    Spycoclown

Share This Page