bluelightning32 / vs-gourmand

Vintage story mod to give a health buff for eating a greater variety of foods
MIT License
1 stars 0 forks source link

V1.2.0 code error #1

Open Aeliaz opened 1 month ago

Aeliaz commented 1 month ago

Hello !

I've updated “Gourmand” to version 1.2.0. On generating a new world, here's the error it gives me: In game, the mod doesn't seem to have launched. No other mods have been added.

1.10.2024 11:56:14 [Server Error] [gourmand] Exception: An item with the same key has already been added. Key: glueportion-pitch-hot
   at System.Collections.Generic.Dictionary`2.TryInsert(TKey key, TValue value, InsertionBehavior behavior)
   at System.Collections.Generic.Dictionary`2.Add(TKey key, TValue value)
   at Gourmand.MatchRule.GetRecipeDict(IEnumerable`1 recipes)
   at Gourmand.MatchRule.GetRecipeDict(IModLoader loader)
   at Gourmand.CategoryDict.LoadStackRules(IWorldAccessor resolver, ILogger logger, IEnumerable`1 stackRules)+MoveNext()
   at System.Linq.Enumerable.ConcatIterator`1.MoveNext()
   at Gourmand.Collectibles.MatchRuleSorter..ctor(IEnumerable`1 rules, IModLoader modLoader)
   at Gourmand.Collectibles.MatchResolver.Load(IEnumerable`1 rules)
   at Gourmand.CategoryDict.Set(IWorldAccessor resolver, ILogger logger, IEnumerable`1 collectibleRules, List`1 stackRules)
   at Gourmand.GourmandSystem.LoadCategories(ICoreServerAPI sapi)
   at Gourmand.GourmandSystem.AssetsLoaded(ICoreAPI api)
   at Vintagestory.Common.ModLoader.TryRunModPhase(Mod mod, ModSystem system, ICoreAPI api, ModRunPhase phase) in VintagestoryLib\Common\API\ModLoader.cs:line 660
1.10.2024 11:56:14 [Server Error] Failed to run mod phase AssetsLoaded for mod Gourmand.GourmandSystem
bluelightning32 commented 1 month ago

Previous versions of Gourmand duplicated the recipe details in terms of which ingredients they take. This was untenable with Expanded Foods, due to the number of recipes it adds and the number of ingredients it has in the recipes.

So version 1.2.0 switched to importing recipes by name. That error message means that it found two copies of the glueportion-pitch-hot recipe. Gourmand does not use that specific recipe, so I could hard code it to ignore that one. However, the exception means there is something wrong with your game install. There's a good chance that if I ignore that one, then more recipes would have conflicts.

My guess is that you somehow made a copy of part of the assets folder within itself. Like you did accidentally did a ctrl-c, ctrl-v from file explorer on something in the assets folder. The file that's causing a problem should only be at assets/survival/recipes/cooking/glue.json.

The other possibility is that you installed a mod which copied the recipe instead of patching the existing one. So if you can't find the duplicate file, then please give me a list of all mods installed on your server.