Fabricators-of-Create / Create

[Fabric Mod] Building Tools and Aesthetic Technology
MIT License
852 stars 190 forks source link

`BottomlessItemHandler` reports itself as having 0 slots #1036

Closed SquidDev closed 11 months ago

SquidDev commented 11 months ago

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:

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.

  1. Place down a creative crate and add an item into it.
  2. Place down a computer next to it.
  3. 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

SquidDev commented 11 months ago

Thank you!