No method to consume food
Kan18 opened this issue ยท 3 comments
Previously plethora allowed consumption of food via ni.getInventory().getItem(slot).consume()
. Now that Plethora does not implement inventory methods, getItem
and consequently consume
have been removed. This prevents automatic consumption of food.
It's an NYI and likely will come in to close this issue, but it wouldn't work the same way as the transfer API is very different in CC:T, similar to the issue of adding inventory
and ender_chest
transfer locations to the neural interface (something I have been discussing with SquidDev). At the moment, as a design choice, Plethora avoids implementing any of it's own transfer/inventory methods, and always leaves that task to CC:T.
Some more 5 AM rambling:
Looking closer at ItemSlot (if you were the same person who asked in Discord earlier), the three vanilla methods it implements are:
consume()
(this issue)drop()
setActive()
- for Elytra, which I think we will skip for now
We have decided not to implement suck()/drop() for in-world inventories, but for the player inventory it may still be reasonable to implement. So what I think we could do is instead add consume(slot)
and drop(slot, [...])
to the player's wrapped inventory object (RangedInventoryWrapper, from EntityIntrospectionModules). So the new approach would look something like:
local modules = peripheral.wrap("back") -- with an Introspection Module
local playerInv = modules.getInventory()
playerInv.consume(1) -- Consume the item in slot 1
playerInv.drop(1, 64) -- Drop 64 items from slot 1
Let me know what you think of this.