[INACTIVE][MECH] Gastronomic v1.3.4 - Adding realism through hunger. [766]

Discussion in 'Inactive/Unsupported Plugins' started by fullwall, Jan 28, 2011.

  1. Offline

    fullwall

    [​IMG]
    The first specialised hunger plugin for Bukkit!
    Now with Thirst - open GastronomicWater Spoiler!

    Download latest release: v1.3.4 (Uses Permissions)
    Older Versions: 1.33, 1.31, 1.3, 1.26, 1.25, 1.2, 1.1, 1.0, 0.1
    Direct link to latest: here

    Ever felt like something was missing from Bukkit? A sense of immersion, of depth? Ever felt like people shouldn't be able to survive for weeks without a single piece of food? Gastronomic provides a reason to kill those pigs, catch that fish, and cook that bread. So gather up your [wheatpicked], [redmushroom] and [meat], and keep reading.

    Features:
    • User-specified hunger intervals, increments, and damage amounts.
    • Per-item hunger restoration amounts.
    • 'Effects' system allowing very customisable health restoration/damage effects.
    • Permissions support.
    Permissions:
    Give gastronomic.admin.* support to trusted players, and gastronomic.player.* permissions to all, or configure permissions manually from the list below.
    Code:
    gastronomic.admin.enable - gives access to the /gastronomic command.
    gastronomic.admin.reload - gives access to the /gastronomic reload command.
    gastronomic.admin.sethunger - gives access to the /sethunger command.
    gastronomic.player.checkhunger - gives access to the /hunger command.
    gastronomic.player.checkfood - gives access to the /food command.
    gastronomic.disablehunger - give this permission to disable hunger for the user/group.
    
    Commands:
    Code:
    /gastronomic - enables and disables plugin.
    /gastronomic reload - reloads all configuration files.
    /hunger - checks your current hunger level.
    /sethunger [player name] [hunger level] - sets player's hunger to the specified amount.
    /food [id] - tells the player how much hunger the id restores.
    /food list - lists how much hunger each food id restores.
    
    Known issues:
    • If configuration files are deleted for any reason, the server may show some scary messages. Don't worry, it should work out fine! If not, report please :).
    • In GastronomicWater, users must left click to empty buckets (bug with bukkit not calling correct events on bucket use)
    Planned Features:
    • Suggest some!
    Changelog:
    v1.3.4 - compatibility, bugfixes.
    Older Versions (open)

    v1.33 - bugfixes, permissions are now opt-out
    v1.31
    • Finally fixed hunger saving (!)
    v1.3
    • Lotsa bugfixes (tm)
    v1.26
    • Incremented version number to reflect amount of bugfixes/new features added to 1.2.
    v1.2
    • Player hunger resets to initial-hunger after death.
    • Added enforce-limit setting to stop hunger going below 0 after death.
    • Added hunger restoration settings.
    • Allowed eating cake.
    • Added /food [id] command to get food hunger restoration value. Add gastronomic.player.checkfood to allow access.
    • Messages are now only sent to the player upon reaching the threshold.
    • Lots of bugfixes.
    • Changed the way players are added/removed on join/quit.
    v1.1
    • Added /gastronomic reload command.
    • Added initial-hunger setting to allow users to start at varying levels of hunger.
    v1.0
    • Added Permissions support.
    • Changed versioning scheme to reflect this.
    • Added support for messages with colour codes, as defined in the properties file.
    • Fixed miscellaneous bugs.
    • Hunger values can go below 100.
    v0.1 - initial release.
    Mechanics (open)

    Each player is given a hunger value, starting at 0. Every so often, at a user-specified interval, every user's hunger level goes up by a specified increment. This goes on until their hunger level reaches 100, and they begin to starve. At every following interval, damage will be taken until food is eaten, restoring hunger levels back to 0.
    Credits (open)

    • Firstly to this thread for inspiring the creation of Gastronomic. Thanks to Bashur and the other posters in that thread!
    • Secondly to TimberJaw, whose Hey0 mod (here) served as ideas for some of my plugin's functionality.
    GastronomicWater (open)
    Please note - this is not updated for 766 yet.
    Download link: 1.11, 1.0

    GastronomicWater has exactly the same features as Gastronomic, but with a separated config file.
    Commands are:
    /drink [id]
    /drinks
    /gastronomicwater (reload)
    /thirst
    /setthirst [player name] [thirst]
    gastronomic.admin.enable - gives access to the /gastronomicwater command.
    gastronomic.admin.reload - gives access to the /gastronomic reload command.
    gastronomic.admin.setthirst - gives access to the /setthirst command.
    gastronomic.player.checkthirst - gives access to the /thirst command.
    gastronomic.player.checkdrink - gives access to the /drink command.
    gastronomic.disablethirst - give this permission to disable hunger for the user/group.

    As this is an early release (and my first actual plugin), please report any bugs or issues, and also features you'd like to be added - I'm always open to suggestions! Also taking suggestions for my next plugin.
     
  2. Is the reset hunger by suicide thing is solved ? I redownloaded, but it's still not working :(
     
  3. Offline

    fullwall

    It's reset now based on what you set as respawn hunger in the properties.
     
  4. I tried again, but it's not working, i must do something wrong :s

    Code:
    # What hunger level respawning players return to
    hunger-respawn=80
    
    # Set to true to enable resetting hunger on respawn
    reset-hunger-respawn=false        // Also tried on true ...
    Still getting 0 hunger after death :(

    EDIT : When i die, i get the message at 80 hunger, then when i click respawn i go back de 0.
     
  5. Offline

    BigRedWood

    Has there been a fix for this error?
    Code:
    2011-03-15 12:55:53 [SEVERE] Could not pass event PLAYER_QUIT to Gastronomic
    java.lang.NullPointerException
    	at java.util.Hashtable.put(Unknown Source)
    	at java.util.Properties.setProperty(Unknown Source)
    	at com.fullwall.Gastronomic.PlayerHunger.savePlayerHunger(PlayerHunger.java:237)
    	at com.fullwall.Gastronomic.Listener.onPlayerQuit(Listener.java:201)
    	at org.bukkit.plugin.java.JavaPluginLoader$2.execute(JavaPluginLoader.java:167)
    	at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:59)
    	at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:255)
    	at net.minecraft.server.ServerConfigurationManager.c(ServerConfigurationManager.java:115)
    	at net.minecraft.server.NetServerHandler.a(NetServerHandler.java:551)
    	at net.minecraft.server.NetworkManager.a(SourceFile:234)
    	at net.minecraft.server.NetServerHandler.a(NetServerHandler.java:76)
    	at net.minecraft.server.NetworkListenThread.a(SourceFile:100)
    	at net.minecraft.server.MinecraftServer.h(MinecraftServer.java:357)
    	at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:272)
    	at net.minecraft.server.ThreadServerApplication.run(SourceFile:366)
    I get it quite often.
     
  6. Offline

    ImKharn

    #Apple
    260=50:1

    #Mushroom Stew
    282=100:10

    #Bread
    297=100:3

    #Raw Pork
    319=20:1

    #Cooked Pork
    320=100:3

    #Golden Apple
    322=100:10

    #Raw Fish
    349=20:1

    #Cooked Fish
    350=100:5

    Any reason this is not changing the health value from food?
     
  7. Offline

    enkryptor

  8. Offline

    TheMap

    Im getting this error from the 1.3 build on CB recommended 531 , im using group manager. The error seems to mention world guard but the funny thing is I don't even have it.

    Code:
    [SEVERE] com/sk89q/worldguard/bukkit/WorldGuardPlugin loading Gastronomic v1.3 (Is it up to date?)
    java.lang.NoClassDefFoundError: com/sk89q/worldguard/bukkit/WorldGuardPlugin
        at com.fullwall.Gastronomic.Gastronomic.setupWorldGuard(Gastronomic.java:115)
        at com.fullwall.Gastronomic.Gastronomic.onEnable(Gastronomic.java:81)
        at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:118)
        at org.bukkit.plugin.java.JavaPluginLoader.enablePlugin(JavaPluginLoader.java:451)
        at org.bukkit.plugin.SimplePluginManager.enablePlugin(SimplePluginManager.java:217)
        at org.bukkit.craftbukkit.CraftServer.loadPlugin(CraftServer.java:83)
        at org.bukkit.craftbukkit.CraftServer.loadPlugins(CraftServer.java:61)
        at net.minecraft.server.MinecraftServer.e(MinecraftServer.java:204)
        at net.minecraft.server.MinecraftServer.a(MinecraftServer.java:191)
        at net.minecraft.server.MinecraftServer.d(MinecraftServer.java:131)
        at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:246)
        at net.minecraft.server.ThreadServerApplication.run(SourceFile:366)
    Caused by: java.lang.ClassNotFoundException: com.sk89q.worldguard.bukkit.WorldGuardPlugin
        at java.net.URLClassLoader$1.run(URLClassLoader.java:217)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.net.URLClassLoader.findClass(URLClassLoader.java:205)
        at org.bukkit.plugin.java.PluginClassLoader.findClass(PluginClassLoader.java:30)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:319)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:264)
        at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:332)
        ... 12 more
    
     
  9. Offline

    fullwall

    Redownload, fixed some of your issues.
     
  10. Hello fullwall! Just tested the recent version with CB493. No problems on usual ground/areas. You can no longer eat on WorldGuard restricted land. When you look on the ground you get the usual "no permission" message and no food is consumed.
    But when you dont look on the restricted ground (e.g. look into the air) you can consume the food (good) but the hunger level does not get changed (bad, hehe).
    Grats to get a step towards fixing the exploit! Hope you get the part fixed so the consumed food actually changes hunger level!
     
  11. Offline

    Proteh

    Hello fullwall!

    Please reply me, I'm getting this error:

    [SEVERE] com/sk89q/worldguard/bukkit/WorldGuardPlugin loading Gastronomic v1.3 (Is it up to date?)
    java.lang.NoClassDefFoundError: com/sk89q/worldguard/bukkit/WorldGuardPlugin
    at com.fullwall.Gastronomic.Gastronomic.setupWorldGuard(Gastronomic.java:115)
    at com.fullwall.Gastronomic.Gastronomic.onEnable(Gastronomic.java:81)
    at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:118)
    at org.bukkit.plugin.java.JavaPluginLoader.enablePlugin(JavaPluginLoader.java:451)
    at org.bukkit.plugin.SimplePluginManager.enablePlugin(SimplePluginManager.java:217)
    at org.bukkit.craftbukkit.CraftServer.loadPlugin(CraftServer.java:83)
    at org.bukkit.craftbukkit.CraftServer.loadPlugins(CraftServer.java:61)
    at net.minecraft.server.MinecraftServer.e(MinecraftServer.java:204)
    at net.minecraft.server.MinecraftServer.a(MinecraftServer.java:191)
    at net.minecraft.server.MinecraftServer.d(MinecraftServer.java:131)
    at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:246)
    at net.minecraft.server.ThreadServerApplication.run(SourceFile:366)
    Caused by: java.lang.ClassNotFoundException: com.sk89q.worldguard.bukkit.WorldGuardPlugin
    at java.net.URLClassLoader$1.run(URLClassLoader.java:217)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(URLClassLoader.java:205)
    at org.bukkit.plugin.java.PluginClassLoader.findClass(PluginClassLoader.java:30)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:319)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:264)
    at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:332)
    ... 12 more

    and I even don't have WorldGuard!

    What could be causing it? I really want this plugin for my server!
     
  12. Offline

    fullwall

    Redownload the plugin please.
     
  13. Offline

    Proteh

    Cool, thanks, it works now!

    But I noticed something, the cake doesn't regenerate hunger, it only gives hearts.
     
  14. Offline

    AnjoCaido

    Code:
    19:04:29 [SEVERE] null
    org.bukkit.command.CommandException: Unhandled exception executing command 'sethunger' in plugin Gastronomic v1.3
            at org.bukkit.command.PluginCommand.execute(PluginCommand.java:37)
            at org.bukkit.command.SimpleCommandMap.dispatch(SimpleCommandMap.java:80)
            at org.bukkit.craftbukkit.CraftServer.dispatchCommand(CraftServer.java:229)
            at net.minecraft.server.NetServerHandler.c(NetServerHandler.java:645)
            at net.minecraft.server.NetServerHandler.chat(NetServerHandler.java:608)
            at net.minecraft.server.NetServerHandler.a(NetServerHandler.java:602)
            at net.minecraft.server.Packet3Chat.a(SourceFile:24)
            at net.minecraft.server.NetworkManager.a(SourceFile:230)
            at net.minecraft.server.NetServerHandler.a(NetServerHandler.java:76)
            at net.minecraft.server.NetworkListenThread.a(SourceFile:100)
            at net.minecraft.server.MinecraftServer.h(MinecraftServer.java:357)
            at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:272)
            at net.minecraft.server.ThreadServerApplication.run(SourceFile:366)
    Caused by: java.lang.ArrayIndexOutOfBoundsException: 1
            at com.fullwall.Gastronomic.Gastronomic.onCommand(Gastronomic.java:151)
            at org.bukkit.command.PluginCommand.execute(PluginCommand.java:35)
            ... 12 more
    
     
  15. Offline

    davr

    Two things:

    1. It seems like my player's hunger is always getting reset, it's not remembering the value between logins. Is it supposed to always remember? Are there things that can cause it to forget?

    2. Got an NPE when a player quit. Didn't notice any adverse effects, but you should probably trap the error just in case:
    22:10:57 [INFO] robbiet480 lost connection: disconnect.quitting
    22:10:57 [SEVERE] Could not pass event PLAYER_QUIT to Gastronomic
    java.lang.NullPointerException
    at java.util.Hashtable.put(Hashtable.java:411)
    at java.util.Properties.setProperty(Properties.java:160)
    at com.fullwall.Gastronomic.PlayerHunger.savePlayerHunger(PlayerHunger.java:237)
    at com.fullwall.Gastronomic.Listener.onPlayerQuit(Listener.java:207)
    at org.bukkit.plugin.java.JavaPluginLoader$2.execute(JavaPluginLoader.java:167)
    at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:59)
    at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:255)
    at net.minecraft.server.ServerConfigurationManager.c(ServerConfigurationManager.java:115)
    at net.minecraft.server.NetServerHandler.a(NetServerHandler.java:551)
    at net.minecraft.server.NetworkManager.a(SourceFile:234)
    at net.minecraft.server.NetServerHandler.a(NetServerHandler.java:76)
    at net.minecraft.server.NetworkListenThread.a(SourceFile:100)
    at net.minecraft.server.MinecraftServer.h(MinecraftServer.java:357)
    at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:272)
    at net.minecraft.server.ThreadServerApplication.run(SourceFile:366)

    Other than that, the plugin is great, I think it adds something of real value to the game.

    version infos:

    [INFO] [Gastronomic] version [1.3] (Hearty) loaded
    [INFO] This server is running Craftbukkit version git-Bukkit-0.0.0-544-g6c6c30a-b556jnks (MC: 1.3)
    java version "1.6.0_20"
    OpenJDK Runtime Environment (IcedTea6 1.9.7) (6b20-1.9.7-0ubuntu1~10.04.1)
    OpenJDK 64-Bit Server VM (build 19.0-b09, mixed mode)
    Linux a010 2.6.32-29-server #58-Ubuntu SMP Fri Feb 11 21:06:51 UTC 2011 x86_64 GNU/Linux
     
  16. Offline

    fullwall

    Anjo - I can't trace the error until you redownload from 1.3 and paste the error again for the line number. Davr - is there anything in the Gastronomic.users file? Try redownloading and try again Davr.
     
  17. Offline

    ImKharn

    Currently this mod hurts the player then heals them to lower the health gain from food.
    This kills players at low HP.

    Please change to code to this order:

    The game heals for default amount for the food.
    IF (player has less than full hp)
    Then [apply the modifier from foodstuffs properties to players hp]

    It still wont be perfect in some cases, but at least it is better than players dieing from your plugin.
     
  18. Offline

    fullwall

    Try redownloading.
     
  19. Offline

    davr

    There is one user in the .users file, but that user is not me.

    Also...every time you say "Try redownloading", are you actually uploading a new version? Or are you just implying that somehow re-downloading the same file will fix the problem? If it's the former, you should update the version number so we can keep track if there's a new version, thanks.
     
  20. Offline

    Shenlong

    Just thought I'd let you know, when I download from the "Direct Link to Latest" it gives me an error when loading. The "1.3" link works just fine. CraftBukkitUpToDate also seems to download the broken version.
     
  21. Offline

    fullwall

    To davr - the former. Link fixed.
     
  22. Fully agree. Its really confusing never to be sure if something has been updated and actually what has been updated. Two "Try redownloadings" before I thought that it was also another fix for the protected areas but it still behaved as before. So Im still not sure if there was anything updated or it was just a hint to the poster after me who seemed to use an outdated version.
    Very confusing...
     
  23. Offline

    fullwall

    I'm sorry :(. Just that, look at the amount of me saying to redownload. I would have to increment the version number each time... :S. Sorry.
     
  24. Offline

    Tobei

    "Your health is restored by +healthr+." seeing this in game as a regular player.
    Shouldn't that be a variable which reports the amount of health regenerated during the restoration period of hunger?
     
  25. fullwall, sent you a pm with a serious bug weve found.
     
  26. Offline

    sawyer

    how do you use the thirst do you have to get a water because it might be hard for some people to get iron if a few days
     
  27. Offline

    Tobei

    You can setup the properties to set thirst to like -100 for new players to allow time to get iron... I have it set to that for hunger to allow a grace period at first :)
     
  28. Offline

    timmaeh

    same here.
     
  29. Offline

    fullwall

    Redownload for a +healthr+ fix. Still not sure about the respawn hunger thing.
     
  30. Hey fullwall! Thanks again for the fast fix - we've just tested it (CB493).

    - after dying from hunger your inventory is completly cleared and nothing drops!
    - you dont die when chat is open. As soon as you close it youre dead (minor glitch, imo)
    - staying on protected land (WorldGuard, Towny) and dont looking on the protected land seems to ignore the properties (food is consumed, vanilla hearts healed, hunger level not adjusted)

    cheers
     
  31. Offline

    fullwall

    The second item is a minecraft bug XD. Yeah, I still don't know why that happens... seems like a problem with worldguard.
     

Share This Page