IntelligenceModding / Advanced-Peripherals-Features

A place for the feature request for Advanced Peripherals
0 stars 1 forks source link

Inventory Manager - Support backpack/storage mods #101

Open chuman72486 opened 2 days ago

chuman72486 commented 2 days ago

Describe your idea (If you have more than one idea, please open the rest in other issues)

Is it possible for the Inventory Manager to access the inventory inside of items in the player's inventory? For example the Sophisticated Backpacks and Traveler's Backpack mods let the player carry a backpack that is like a chest they can carry in their inventory. It would be helpful if the Inventory Manager could reach into those backpack storages and insert/remove items and fluids and stuff.

As far as I'm aware, the backpack's contents are stored in NBT data, so it should be possible to use that to access the contents of the backpack. I currently use the feeding upgrade for my backpack to automatically eat the food I keep in a specific slot in the backpack. However, if I run out of food, the only way to refill it is to open my ME Terminal, put the food into my inventory, then open my backpack and move the food into the backpack (or I can right click the backpack while holding a stack of food) It would be nice if my computer can monitor my backpack and refill the food automatically from my ME storage using the ME Bridge and Inventory Manager peripherals. Since I carry multiple backpacks, maybe my computer can automatically transfer items between the backpacks so I can keep loot organized.

Basically just apply all of CC's inventory functions to both the player's inventory, and the contents of any backpacks or other items with storage.

Add functions: isContainer(itemSlot) - returns true if the item in the selected slot has its own inventory getContainerItems(itemSlot) - returns the same as getItems(), but for the contents of the selected item. addItemToContainer(itemSlot, direction, item) - basically the same as addItemToPlayer(), but with the added argument selecting the container to push the item to removeItemFromContainer(itemSlot, direction, item) - same as above, but to get an item out of the container maybe also container equivalents for getFreeSlot(), isSpaceAvailable() and getEmptySpace()

As a bonus, maybe also make it so a bee nest can be checked if there's a bee inside. (and what kind of bee, if certain mods are installed)

Describe alternatives you've considered if any

No response

Additional context

No response

Linked Issues

No response

zyxkad commented 2 days ago

This need specific implementation since there is no general way to declare an item as a storage item. So if it implemented, it may only support some common mods. I probably won't look at this within a year.

chuman72486 commented 2 days ago

In my case, I found this mod through the ATM9 modpack, so my hope would be to at least support the backpack mods from that modpack, specifically Sophisticated Backpacks and Traveler's Backpacks.