Stormwind99 / FoodFunk

Minecraft mod: What is that funky smell in my backpack? Food spoils over time unless preserved. Configure any item to rot, any container to preserve items.
https://minecraft.curseforge.com/projects/food-funk
GNU Lesser General Public License v3.0
10 stars 8 forks source link

Perishables do not work in certain CraftTweaker scripts when foodfunk.cfg exists in config folder #65

Open katubug opened 4 years ago

katubug commented 4 years ago

Describe the bug Rottable food cannot be used in CraftTweaker scripts, because of how the mod adds rotting NBT data to them. I'm not a modder so I cannot say why this occurs, but if in a CraftTweaker script, I specify <minecraft:beef> in a recipe, the recipe will not be craftable because the mod changes the item specification to <minecraft:beef>.withTag({Rot: {start: 0 as long, time: 0 as long}}). I have tried numerous workarounds to get the scripts to be NBT-agnostic, but nothing has worked.

I am heartbroken, as I was deeply looking forward to utilizing this mod alongside Canny Composter in a modpack I'm working on, but this bug has prevented me from doing a lot of crucial things. I can't add tooltips to food items, I can't change recipes to use different perishable ingredients, I cannot use food items as potion catalysts, and I cannot even use HungerTweaker to change the values of foods. Adding OreDict tags and Furnace recipes work, for some reason.

To Reproduce Steps to reproduce the behavior:

  1. Install Food Funk (4.9.5) and CraftTweaker (4.1.20). My forge version is 2847.
  2. Write a script that references a perishable item.
  3. Load up the game and attempt to execute the script.
  4. In the crafttweaker log, you'll note that all instances of the perishable ingredient have .withTag({Rot: {start: 0 as long, time: 0 as long}}) appended.

Expected behavior I expect the script to use the item as I typed it, without the following NBT specifications.

Logs & Config files latest.log, crafttweaker.log, foodfunk.cfg, wumpleutil.cfg: https://paste.ee/p/zqxnQ

Screenshots Here you can see the recipe for Onion Pie, which I've configured to accept Onions instead of Allium: 2019-12-21_21 59 17

This is the crafting table with the recipe inputs, not outputting the product. 2019-12-21_21 59 30

Thanks very much for your time!

katubug commented 4 years ago

Just wanted to add a quick update to this: the issue persists with Food Funk 4.9.6/WumpleUtil 2.12.7.

I may have found a potential workaround for parts of it, by using Hunger Overhaul to change hunger/saturation values for food, by exempting certain edible ingredients from rotting, and by adding ore dictionary tags to others (since that works) and using those in recipes instead of direct item IDs. I am bound and determined to include this mod, lmao!

Anyway, I am not intending to pressure you by posting this, just wanted to keep the thread up to date, and let you know I'd found a possible solution to working around this on the client side. :)

I hope you have a fantastic holiday! Thank you again for your time, and please let me know if there's any other information I can provide or testing I can do for you. And for all the time and effort you've put into making these mods for us to use: It's an exceptionally kind thing of you to do, and oftentimes a thankless task. So, thank you!

Edit: one final note - If you think it would be helpful, I can report this to CraftTweaker as well? Just let me know and I'll get it done. :)

Stormwind99 commented 4 years ago

First thoughts:

I don't see how a mod like Food Funk could work without NBT (since flattening would not work due to near-infinite timestamps possible). I've never used CraftTweaker myself, but it seems like adding NBT-agnostic item identification to CraftTweaker itself would be the best way, and a useful feature for CraftTweaker to have with NBT data being more used nowadays.

I'm taking a wild guess that the {Rot: {start: 0 as long, time: 0 as long}} NBT data is coming from a non-real item that something created to look at it for data, since the Rot NBT is uninitialized (it should have the timestamp and rot time, not 0's).

Stormwind99 commented 4 years ago

It would help if you could provide all of the files (Crafttweaker scripts, config, data, etc) to duplicate this situation.

katubug commented 4 years ago

From my experience, CraftTweaker is NBT agnostic except when specified otherwise, as I've never had this issue with any other potentially-NBT'd item, like books, tools, potions etc. I also tried to specify the script to use any NBT value, but either I did it wrong, or it's not working.

My configs and such from my working modlist are attached to the initial issue, but I'll create some from an isolated instance.


Update! While setting up a testing instance, I came up against a very unusual thing: suddenly parts of the script were working. I did a couple of tests where I forgot to write down what changes I'd made, but once I realized there was likely something else happening, I started documenting my troubleshooting. Here are my findings:

Mods in instance:

crafttweaker.log: https://pastebin.com/ve5fqGVX latest.log: https://pastebin.com/kiwNtURR foodfunk.zs script: https://pastebin.com/XgqF6zzB wumpleutil.cfg (default) and foodfunk.cfg (default): https://paste.ee/p/lBR7E

All tests were conducted in the same instance, loading the same world, created solely for this purpose. New configs were generated for Food Funk and WumpleUtil and were not edited. No errors caught by VSCode or /ct syntax, nor any shown in the crafttweaker log. Sporadically, each part of the script stops or starts working. So far I haven't found a pattern. Each line has worked at least once in this instance.

At this point I felt that a few other tests were needed in case there's another factor involved in this. After all, in my main instance, various parts of the script were failing. So:

So, my final conclusions from all of this are that there's something weird about the interaction between the existing foodfunk.cfg file and CraftTweaker, that doesn't happen when the file is first generated. I have no idea why that would be, but that's what I've got. xD

Please let me know if there's anything else I can help with - testing or logging or anything. :) Thank you for taking a look at this btw, I really appreciate it!

katubug commented 4 years ago

Hey, I'm sorry to bother you, but I thought I would reiterate my offer of helping you debug. I'm sure you're busy so if there's anything I can do, please let me know! Also please tell me if you think I should report this to the CraftTweaker team as well.

Thank you for your time and consideration! I appreciate it :D

Pingu-Pox commented 2 years ago

@katubug Did you end up removing Food Funk from your modlist?

Ski-z commented 1 year ago

I'd love an update! Did you ever get foods in a CT recipe script working?