enjarai / recursive-resources

Minecraft mod that enhances the Resource Pack menu with folder support.
Mozilla Public License 2.0
15 stars 8 forks source link

[Bug] folder config file is reset whenever resource pack menu is opened #37

Closed ConradwithaK closed 5 months ago

ConradwithaK commented 5 months ago

For someone like me who uses like 10+ resource packs at once, it is extremely important to deploy them in the correct order, but after I put mine into a folder in the correct order, they deployed alphabetically in-game. Please add a way to control the deploy order.

enjarai commented 5 months ago

This is a feature that already exists, though its a little unintuitive to use. See the folder.json configuration section of the mod's project page.

You've probably seen a file named folder.json in the screenshots above, this file is used to configure some extra properties for the folder it is inside of. One of these files will be automatically created when you create and enter a new folder. Opening it up in a text editor, you should see a structure similar to this:

{
  "icon": "icon.png",
  "description": "",
  "packs": [
    "circular hotbar.zip",
    "Not Microsoft"
  ],
  "hidden": false
}

These fields represent the following:

  • icon - The name of the icon file to use for this folder, relative to this folder.
  • description - A description of the folder, shown under its name.
  • hidden - Whether or not to hide this folder from the list.

The packs field is a little more complicated. It contains a list of all packs in the current folder, in the order in which they'll be displayed and applied. While you can reorder these as you please, removing one will cause it to be added back automatically so long as its file is still in the folder.

ConradwithaK commented 5 months ago

Every time I reopen the game, it erases any changes I've made to the folder config file including the deploy order I've set and the folder description.

enjarai commented 5 months ago

Make sure you close the resource pack screen while making edits, then reopen it after. I should probably add a check for that honestly...

ConradwithaK commented 5 months ago

That is in fact the issue, but when I reopen the resource pack screen it still undoes my edits.

enjarai commented 5 months ago

Hmm thats definitely not supposed to happen, maybe a recent update broke something there. I'll look into it.

enjarai commented 5 months ago

I'm unable to recreate this issue on the latest 1.20.4 version, what version of the mod are you using?

ConradwithaK commented 5 months ago

I was using the latest version from modrinth as of last evening. Can’t elaborate further until I get home.

enjarai commented 5 months ago

What version of Minecraft was this on?

ConradwithaK commented 5 months ago

1.20.4

enjarai commented 5 months ago

Hmm okay thats quite strange then. Just to eliminate factors, what OS are you using? (It shouldnt matter, but it might??)

ConradwithaK commented 5 months ago

Windows 11 Pro I think (not entirely sure cuz I’m on a new laptop)

enjarai commented 5 months ago

Okay that probably isnt it then, I'll try some stuff.

I'm also thinking the mod might be replacing the json file because its not correctly formatted. If it is, thats not intended behaviour, but it would explain your issue. Maybe try running your file through a json linter before opening the pack screen again when you get home?

ConradwithaK commented 5 months ago

I’ll try it, but I think it was the right format because all I did was ctrl+x each pack listing and ctrl+v into the right order.

ConradwithaK commented 5 months ago

That was the issue. When had I copied the lines for the texture pack listings, I was also copying the commas at the end of each line, so in the middle of the list there was no comma and at the end there was one. Took me a second to figure it out after opening the json linter, but it worked. Thanks for the help!

enjarai commented 5 months ago

Ah okay, good to know its fixed. I'll see if I can add some more clear validation for this kind of stuff instead of just overwriting the file.