Roundaround / mc-fabric-inventory-management

MIT License
7 stars 6 forks source link

Buttons don't appear in modded chests #18

Open CaesarSP opened 1 year ago

CaesarSP commented 1 year ago

Hello, hope you are having a good day.

I've been playing with your mod in 1.20.1 Fabric lately, and storage units from Expanded Storage do not show the Inventory Management UI beside the opened chest; only the player inventory one. The chest has the same dimensions as a normal minecraft double chest, so it isn't button overlapping.

So, my question is: Is there a mod incompatibility or am I need to configure something in particular? If there's an incompatibility, please consider this as a suggession for trying to add support for the mod.

Thanks in advance.

(Image of the inventory of one modded double chest)

2023-07-10_14 44 05

cnmhqwerty commented 1 year ago

Would also like a way to make this mod compatible with modded chests (currently using the reinforced series of mods by Aton-Kish https://modrinth.com/user/Aton-Kish)

mamokin commented 9 months ago

this seems to be a common issue with all sorting mods atm. rather annoying. the "Sort" mod works but only in creative mode for modded inventories thus being useless

DrERRORz commented 8 months ago

Same issue, came here looking for a way to fix it.

mpustovoi commented 7 months ago

Also looking forward to compatibility with Expanded Storage mod (https://modrinth.com/mod/expanded-storage)

Roundaround commented 6 months ago

Hey folks! I've been putting off chiming in here as long as I could but given there are so many people reporting the same issue (#2, #23, #29) I figured I need to give some info.

The core of the issue is that this mod relies on a curated list of internal Minecraft code components (classes) by reference to determine when the buttons should be shown. I spent a lot of time getting the system just right so that the buttons are shown only in those situations when they make sense (for example, sorting a dispenser or transferring all from a furnace isn't useful). More importantly, the matching is done via the "Inventory" or "ScreenHandler" (names for the classes in Loom's yarn mappings), rather than the actual block you are accessing. This made the code WAY easier to manage, as I only needed 13 lines registering container types rather than 50 or 60 and didn't require any kind of analysis of the container contents or size. The downside to doing it this way is that this mod by default won't match any containers coming in from mods that are implemented with completely custom logic, because they're not simply extending the vanilla game's classes.

To fix all this (with the current implementation), this mod's registration functions need to be called with a reference to the other mods' appropriate classes. This can happen in their mod or in a separate compatibility mod, but it has to happen somewhere.

My original plan was to improve this either by allowing you to specify additional classes by name in the config or by making some kind of compatibility layer in my mod using Java reflection. In fact, I got decently far into a complete rewrite of the configuration infrastructure but I ran into issues and then life got really busy (very busy at work, followed by the birth of my first child), so I just never had the time to see it through.

I do still want to do it. In fact there are a LOT of things I want to do with this mod to make it better, but the sad truth is that I really don't have the time right now. I only get little windows of time to log in and respond to messages and can't get myself a big enough period to really think through and build anything novel. I know it's not the news you want to hear, but I unfortunately can't do much to help right now. I hope you all understand!

Roundaround commented 6 months ago

So I actually got a few minutes to set up a test environment and toy around.

The in-progress version for Fabric 1.20.3/1.20.4 that I mentioned above where I'm doing a big overhaul actually seems to work just fine with the Reinforced series of mods for the most part. Bit of weirdness with the scrollbar version but otherwise fine. For Expanded Storage, I had to tweak my development environment a bit to run 1.20.4, but then basically the same story - mostly works fine, but with some weird interaction with the scrollbar (and in this case pagination as well). Both of these mods showcase instances where the buttons show up, but sadly getting "proper" integration will likely require cooperation with their respective authors.

The other mods people have mentioned (Inmis, Iron Chests Restocked) don't have a 1.20.3 or 1.20.4 compatible version so I can't check them for compatibility.