Inventory Tweaks [1.12 only]

Inventory Tweaks [1.12 only]

127M Downloads

Dynamically detect chest-shaped (rectangular) containers

asiekierka opened this issue ยท 1 comments

commented

I have some very ugly code in InventoryNeko which accomplishes this: https://github.com/asiekierka/InventoryNeko/blob/master/src/main/java/pl/asie/inventoryneko/NekoInventoryTicker.java#L119-L209

If requested, I could rewrite it to look nicer. I think it could greatly increase InventoryTweaks's compatibility with other mods, as getRowSize() would become unnecessary.

commented

Really getRowSize isn't that important (it's just used for the horizontal/vertical modes)

The main issue is the fact half the mods in the game put the player inventory first, while vanilla and the other half put it last. (And then you get 'fun' things like old galacticraft which went and edited a few things so the real player inventory ended up in the middle)

Even trying to auto-detect that is probably likely to fail in the event of something like a bag/backpack where they're frequently just shoving a random fake slot that just displays an icon and isn't actually tied to anything.

Anyway all this is why the 'API' is designed to be fairly low-effort for the easy cases (If you don't really need anything special or dynamic it's just an annotation, which means you don't even need to include the class files for it in your jar)