Automatic GUI Adaptation
hammy275 opened this issue ยท 0 comments
Due to the need to show the hover-over highlight, Minecraft defines all slot positions in code. In theory, if we know the size of the image (I'm sure there's a way to figure it out programatically), we can deduce where all the slots are relatively in the GUI image and use that to automatically create an Immersive! Note that this would have several, major limitations:
- Only item slots could be adapted. Anything that contains buttons other than item slots would not work (such as the loom).
- This would only work for blocks that store items themselves, since we don't know what needs saving for
WorldStorage
to be useful (such as the crafting table). They would need to beContainer
s, but most are. - This would only work for blocks that would present their items 24/7. In other words, this would not work for blocks that need to be opened (such as the chest).
- It can't tell the difference between a storage block and a non-storage block (chest vs. furnace, for example), which have different interaction methods. As such, we'll assume that they're all non-storage blocks, since most storage blocks are chest variants, and we can't auto-detect chest opening anyways.
This would very likely use a configurable whitelist (really just a tag). ImmersiveMC would supply its own base, that would slowly be discovered over time, while others can add via datapack (or a config if I decide to keep the list out of the tag system).