Project Zomboid

Project Zomboid

190 ratings
Food Preservation Buff
2
   
Award
Favorite
Favorited
Unfavorite
File Size
Posted
Updated
80.336 KB
2 Jan, 2022 @ 1:47pm
19 Feb, 2022 @ 10:30am
12 Change Notes ( view )

Subscribe to download
Food Preservation Buff

Description
Build 41.56+ MP Compatible

The default preservation mechanics for jarring are pretty unrealistic. This mod aims to consolidate several different ideas into a single mod. This mod does not remove the default recipe for jarring but adds two alternative ways to jar and pickle food more reflective of reality.

Jarred Food:
  • Jarred food now returns the lid and the jar when opened.
  • Jarring food only requires water but still needs to be cooked. The requirement for vinegar and sugar is removed.
  • Jarred food will last up to 1 year until stale and 2 years until rotten (Default in the vanilla game is 3 months until rotten).

Pickled Foods:
  • Pickling food requires a lid, jar, water, vinegar, salt and sugar.
  • They do not require cooking and will keep food fresh for 3 years and from rotting up to 5 years.
  • Pickled food are more in-line with the vanilla recipe but with a greatly increased shelf life to better reflect the difficulty involved in acquiring all the ingredients to pickle.

Preserving Meat and Fruit:
  • You can jar or pickle meat in the same way as outlined above. Only works on food acquired through fishing or trapping (Rabbit, Bird etc).
  • You can create jerky by combining salt and 2 butchered meats. The final result will add the hunger values together but can not be any better than -100.
  • You can create fruit jam and marmalade using a jar, varying quantities of fruit, and sugar.
  • All fruit jam and marmalade will give a jar and lid when eaten.
  • Stale and rotten food will add sadness and boredom to jerky, jam and marmalade, but rotten ingredients will not add food poisoning.

Additional Changes:
  • Loot rate for jars, lids, boxes of jars, vinegar, salt and sugar have all been increased.
  • Increased the variety of containers that jars and salt can spawn in.
  • Jar freshness is 99% accurate to its contents. Works with eris food expiry mod**
  • Add recipe to put jars back into a box
  • Alternate mod to require reading a few magazines to unlock the recipes.

Bugs:
  • Vanilla jar recipes are still available but there is no clean way to remove them. Just ignore them.
  • Instead of storing jarred food hunger values individually, it's all averaged together and given back averaged too. Recipe code doesn't let you operate on individual items that come out of the jar, so this is the only way to keep the input equal to the output.

** Using Eris Food Expiry mod will display jarred food expiration date incorrectly when uncooked. You need to cook the jars to get the 2 year until rotten trait, otherwise you could open a fresh jar to receive rotten contents. Debug menu displays correct values. Once the jar of food is cooked the Eris Expiry mod will work correctly and display accurate data.

Having a way to preserve food for long periods of time seemed to be a balancing issue to the devs but considering how common canned food can be even on rare loot settings being able to stockpile farmed food at the expense of rare resources (jars etc.) seems balanced to us.

Other mods that work well with this one:

Choose only one Mod ID! Mags locks all the recipes behind 5 magazines - one for jerky, one for jam, one for marmalade, one for jars of vegetables and one for jars of meat. They closely mimic spawn rates of vanilla skill magazines.

Workshop ID: 2705537463
Mod ID: FoodPreservationBuff
Mod ID: FoodPreservationBuffMags
63 Comments
Duchess 20 Feb, 2024 @ 11:26pm 
Apologies for previous post, that fix is incorrect. The ingredients should read like this (fpb_recipes.txt, lines 152 and 153):

Rabbitmeat/Smallanimalmeat/Smallbirdmeat=2,
Salt;5,

Just tested and it works fine. However, as I said below I think you need two of the same type of meat now, no big deal tho :steamthumbsup:
Duchess 20 Feb, 2024 @ 11:20am 
@Kothonis thanks for posting your fix!

To anyone who still cares about the jerky recipe bug, I think the issue relates to how the recipe is laid out in fpb_recipes.txt. It lists the required items like this (line 152):

Rabbitmeat/Smallanimalmeat/Smallbirdmeat,
Rabbitmeat/Smallanimalmeat/Smallbirdmeat,
Salt;5,

I think doubling up the required items like this creates the bug. Try this instead:

Rabbitmeat=2/Smallanimalmeat=2/Smallbirdmeat=2,
Salt;5,

This is only hypothetical, please let me know if it works. A potential downside of this is that I don't think the recipe will now allow you to mix-and-match different meat types, instead requiring two of the same.
Krilton 4 May, 2023 @ 9:04am 
@CMDR_Lani That mod may have it's own system, I don't know as I also use that mod and have sort of wondered that myself. I just haven't tried. :p
Kothonis 18 Mar, 2023 @ 7:06am 
hey I found a bug where open can would always return me -45 hunger birds and -90 fish and rabbit.
I looked at your code and found that in line 152 you use items:get(0):getWeight() for calculating the hunger of meat when opend but for veggies you use getActualWeight(). changing the line 152 to "result:setHungChange(0 - (items:get(0):getActualWeight() - 0.2) * 6 / divisor)" fixed it for me.
To be honest I I am very confused by the bug either I am the only one having it or items:get(0):getWeight() got deleted resently
CMDR_Lani 7 Feb, 2023 @ 7:45am 
Hey does anyone know if this works properly with Jiggas Green fire ?
Nat 6 Feb, 2023 @ 12:50pm 
Helloo, sorry for bother, I wanna ask if this mod is compatible with LeGourmet Revolution u.u, if anyone knows I'll be grateful n.n
Krilton 8 Jan, 2023 @ 9:56pm 
@Tuna how difficult would it be to jar fruits and would it be possible?
Tuna  [author] 19 Nov, 2022 @ 4:31pm 
oh, that's worth looking into
psubrat 18 Nov, 2022 @ 9:30am 
"Vanilla jar recipes are still available but there is no clean way to remove them. Just ignore them."
Since Obsolete:true doesn't really work (at least last time I tried it) I'm using NeedToBeLearn:true to get rid of recipes (even on your mod). Of course don't forget about Override:true. ;-)
Lomion 24 Oct, 2022 @ 12:34pm 
Can confirm bug from Tofuman and Tahvohck. When i have only one piece of meat in inventory and try to craft jerky, meat just disappears with following error:
[24-10-22 22:12:06.887] LOG : General , 1666638726887> 0> -----------------------------------------
STACK TRACE
-----------------------------------------
Callframe at: PerformMakeItem
function: perform -- file: ISCraftAction.lua line # 58 | Vanilla
function: perform -- file: TailoringFix.lua line # 59 | MOD: Tailoring Fix.
[24-10-22 22:12:06.888] ERROR: General , 1666638726888> 0> ExceptionLogger.logException> Exception thrown java.lang.reflect.InvocationTargetException at NativeMethodAccessorImpl.invoke0 (Native Method)..
[24-10-22 22:12:06.889] ERROR: General , 1666638726889> 0> DebugLogStream.printException> Stack trace:.