`BottomlessItemHandler` reports itself as having 0 slots
SquidDev opened this issue ยท 1 comments
Describe the Bug
BottomlessItemHandler
declares itself as a ItemStackHandler
with 0 slots, and then overrides various methods to pretend to have one slot. However, this implementation is incomplete, which means several methods in SlottedStorage
/SingleSlotStorage
do not behave as expected:
getSlotCount
returns 0.getSlots
returns an empty listgetSlot(0)
throws an out-of-bounds exception, rather than returning the singleton slot.
Reproduction Steps
This doesn't affect most mods, but is an issue with something like ComputerCraft/CC: Tweaked, which uses the SlottedStorage
interface rather than Storage.extract
/Storage.insert
.
- Place down a creative crate and add an item into it.
- Place down a computer next to it.
- Open the Lua REPL (
lua
) and get the size of the crate (peripheral.find("inventory").size()
). This will print 0.
Expected Result
Creative crates would act as an inventory with a single slot.
Screenshots and Videos
No response
Crash Report or Log
No response
Operating System
Linux
Mod Version
0.5.1d
Minecraft Version
1.20.1
Other Mods
No response
Additional Context
No response