Diet (Fabric/Forge/Quilt)

Diet (Fabric/Forge/Quilt)

6M Downloads

Adding new diet groups causes "Incomplete tags" warning

Nohicom opened this issue ยท 24 comments

commented

Minecraft version: 1.16.5
Forge version: 36.1.0
Diet version: diet-forge-1.16.5-0.31

When trying to create new diet groups, loading back into a world (even in singleplayer) causes an error that says "Incomplete set of tags received from server. Please contact server operator." If I try again, this changes to "Errors in currently selected datapacks prevent the world from loading. You can either try to load it with only the vanilla data pack ("safe mode"), or go abck to the title screen and fix it manually." until I close Minecraft and reopen it.

Even after removing the diet group from the world, I need to relaunch Minecraft completely in order to be let back into the world without the "safe mode" warning stopping me. However, at that point it loads fine (without the diet group I want to add).

I have tried deleting the Player data from level.dat and deleting my player's data from the "playerdata" folder, which I needed to do after setting new default values for the existing nutrition types in order for that to take effect, but that did nothing to help.

I have tried putting the new diet group at the bottom of diet-groups.toml, as well as higher up in the list where I wanted the group to show up in-game (above sugars, specifically). I have also tried replacing an existing diet group with the new one, in case the issue was caused by having more than 5 groups.

I also created a new instance with only Forge and Diet, and the issue persists.

Edit: I also tried adding a localization name to the diet group by adding the following line to diet-forge-1.16.5-0.31.jar\assets\diet\lang\en_us.json:
"groups.diet.dairy.name": "Dairy",
But the issue still persists.

The diet group I am trying to add is as follows:
[[groups]]
name = "dairy"
icon = "minecraft:milk_bucket"
color = "#6495ed"
order = 0
default_value = 0.5
gain_multiplier = 1.0
decay_multiplier = 0.5

commented

Can you share your configuration file and your logs from when the error occurred?

commented

I don't think so. I just double-checked with a completely clean install, and it still happens. It's just Minecraft 1.16.5, Forge 36.1.0, and Diet 0.31.

commented

Hmm, very odd then. It's complaining about duplicate tags for some reason. One last thing, do you have a debug.log that you can share as well?

commented
commented

Also, as a side note, is there a better way to localize the display name of the new nutrition group other than modifying the mod's internal files themselves?

commented

Also, as a side note, is there a better way to localize the display name of the new nutrition group other than modifying the mod's internal files themselves?

That's not the standard way to do it, as you should never touch the mod's internal files. You can accomplish the same task by making your own resource pack as described here: https://minecraft.fandom.com/wiki/Resource_Pack#Java_Edition

commented

Ah, alright. So I would have to distribute that resource pack with the localization file in it as part of the modpack I'm making?

commented

Yes. I'm not a modpack developer so perhaps there are other standards available, but that's the way I assume it's done.

commented

Alright, thanks. I'll look into that further later to see if there's a more streamlined way.

Did the debug.log help you at all? I'm not really sure what else I can do on my end here to help figure out what's going wrong.

commented

No, but the other items you presented helped. I believe I know what the issue is, I'm just trying to figure out a solution.

commented

Hmm, do you have any custom tags that you added via a datapack or something?

commented

From what I've been able to gather, I believe this is caused by the fact that you don't have an existing diet:dairy tag which is causing the tag references to fail. Can you make a custom datapack and add the tag for your diet group and see if that resolves your issue?

commented

How would I go about doing that? I've never made a datapack before.

commented

You can read about datapacks here:
https://minecraft.fandom.com/wiki/Data_Pack

The important parts are to create a folder for your datapack, create a pack.mcmeta file to go in it, and then make a data/diet/tags/dairy.json file that looks like this:

{
  "replace": "false",
  "values": []
}

You'll need to learn how to make a datapack at some point for what you're trying to do since that's how you add foods to food groups.

commented

That's really strange. I downloaded your exact datapack, extracted it, put it into my datapacks folder and it worked perfectly. It resolved the issue and the Milk Bucket shows the correct tooltip, showing that it worked successfully.

commented

I don't think making the datapack helped. This is the datapack I created, but the issue still happens. I tried making a new world and loading that datapack into it, and that causes a "Data pack validation failed!" message.

I tried having dairy.json directly in /tags like you said, and also tried in /tag/items like in your Food Classification article on the wiki. I also tried having the "values" array empty, as well as putting items in it. I also tried changing the datapack load order, both for the existing world and the new one I was trying to create, and it doesn't work whether my data pack loads before or after the mod and Forge.

Did I do something wrong with the datapack? Or is the issue still elsewhere? This is my first time trying to make a datapack, so maybe I did something wrong making it.

commented

Can you try this custom build of the mod and see if that fixes anything for you:

diet-forge-1.16.5-0.32.zip

If the issue persists, can you send me the debug.log file again for that instance?

This is the last possible option I have for you at the moment, as I cannot reproduce the issue so I cannot figure out what might be causing it on your end.

commented

Tested with the new mod file, and the issue is still happening. Here is the debug.log file for that test.

At this point I have no idea why this doesn't work for me. Once I get home from work I'll do a second fresh install instance, using the regular Minecraft launcher instead of MultiMC, and even try updating Java.

commented

I tried having dairy.json directly in /tags like you said, and also tried in /tag/items like in your Food Classification article on the wiki.

Sorry, these are incorrect. It should only be in data/diet/tags/items/dairy.json. Nowhere else, and with that exact syntax.

commented

How did you load the datapack? It should only involve putting it into the datapacks folder and loading up the world.

commented

Yeah, I dropped the exact file I sent you into the datapacks folder in the world folder, and the issue persists. Even on the clean install I made earlier when trying to reproduce the issue.

commented

Update: I did a fresh install with the default Minecraft launcher, and downloaded the exact datapack and group config files I sent to you, and they worked fine. Copying those to the MultiMC instances (both the test instance with only the Diet mod, and the instance with the modpack I'm building) worked fine, even with the regular newest release of Diet and not the custom build you made.

At first I thought that the solution was that for some reason, the data packs relating to Diet needed to be zipped, because when I was testing earlier the datapack I made was as an uncompressed folder which I compressed in order to send to you. But I just tried extracting the zip file to a folder again just to try that, and it works fine even as a folder.

I even built a resource pack that changes the display name of the new group properly, and that works fine too.

The only conclusion I can come to is that somehow I wrote something wrong in one of the files when testing, but it got resolved when I sent them to you. Either that, or my computer is cursed. Either way though, thank you so much for all of your help in making this work.

I assume it doesn't matter too much, but for the modpack I'm creating, should I use the custom Diet 0.32 build you sent me? Or should I go back to 0.31 just to be safe?

commented

Glad to hear you got it working! Sometimes issues just magically solve themselves, for better or worse.

I assume it doesn't matter too much, but for the modpack I'm creating, should I use the custom Diet 0.32 build you sent me? Or should I go back to 0.31 just to be safe?

I don't think it should matter, but just to be safe I'm pushing out an official 0.32 update that you can use from CurseForge. It includes some logic that, while it may not affect this issue specifically, is probably still good to have.