Material list keeps unloading
Provide at least the following information
- Minecraft version - 1.21.10
- Mod version and malilib version - LM 0.24.1, MLL 0.26.2
- A clear description of the issue - I keep going from my base out into the field to collect materials, and the material list keeps unloading. I don't get it. I only have one schematic loaded and one placement and STILL the cache keeps vanishing. Is there no way to preserve the material list without keeping it on in the HUD the entire time? I find the inset ugly and unhelpful especially now that I've collected all the materials that would be at the top.
Update: even with the HUD enabled, the whole materials list unloads if I ever try to access it in the nether (by pressing m+l).
The material list system in general currently is in need of tons of usability improvements...
Currently when you open a material list, the mod keeps a reference to that instance, and the only way to re-open the GUI for that same list is using the material list gui hotkey (which you did mention). The mod updates that reference whenever a new material list gui is opened via the GUI buttons, either for a schematic file directly via the Load Schematics menu, or for a placement via the button in the placement configuration menu.
The mod also clears the material list reference whenever the selected placement is changed for whatever reason. When you leave a dimension (or log out of the world), the mod unloads all placement in the dimension where you were in, and if you change dimensions, then it loads the placements and their referenced schematics for the new dimension you are joining. So as a consequence of this, you lose the last material list reference when you change dimensions.
So there is no way around that (losing the list when changing dimensions) currently, it will need changes to the way the material list system works. Those changes are planned, but I myself only work on the "rewrite code base" in the 1.12.2 branch, and due to lack of time IRL that work has been progressing super slowly over the past few years. So don't expect the new thing from my side any time soon.
Now whether Sakura-Ryoko who maintains the 1.21+ mod versions currently wants to make any improvements or changes to the system in the old code base (i.e. what all the current MC 1.13+ mod releases use) is entirely up to her. I'd say it would at least be relatively minor and easy change to simply remove the lines of code that clear the material list reference when the selected placement is changed. The only downside to that is the small change in behavior (that I doubt many if any users even know about) that using the material list hotkey after changing the selected placement does not create a new list for the newly selected placement anymore. You would then need to go and click on the Material List button in the placement configuration menu once.
Or if you simply want to make that change for yourself and build a custom version of the mod. I think it might be just removing this one line: https://github.com/sakura-ryoko/litematica/blob/fca3e8951e84c068a4e2dd249ced9d918d56e7e7/src/main/java/fi/dy/masa/litematica/data/DataManager.java#L399 Although that change might have the risk of some weirdness and problems if you try to update/refresh the material list for a placement that doesn't exist anymore and was in another dimension... So be aware of that.