Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BottomlessItemHandler reports itself as having 0 slots #1036

Closed
SquidDev opened this issue Aug 5, 2023 · 1 comment
Closed

BottomlessItemHandler reports itself as having 0 slots #1036

SquidDev opened this issue Aug 5, 2023 · 1 comment
Labels
type: bug Issue where something isn't working

Comments

@SquidDev
Copy link

SquidDev commented Aug 5, 2023

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 list
  • getSlot(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.

  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 SquidDev added the type: bug Issue where something isn't working label Aug 5, 2023
TropheusJ added a commit that referenced this issue Aug 6, 2023
@SquidDev
Copy link
Author

SquidDev commented Aug 6, 2023

Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug Issue where something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants