Create

Create

86M Downloads

Bug when interacting with StorageDrawers

kcranky opened this issue ยท 3 comments

commented

Describe the Bug

Stockpile switches do not work as expected when observing storage drawers.

This is related to issue #2239 which was closed due to inactivity.

jaquadro, the developer of StorageDrawers, has commented on the sister issue under storage drawers with a potential path for fixing this implementation: jaquadro/StorageDrawers#969 (comment)

Reproduction Steps

  1. Use both storage drawers and create
  2. Place a stockpile switch facing a 1x1 storage drawer.
  3. Place two stacks of items into the drawer, the drawer will be shown as full
  4. Use a storage upgrade on the storage drawer to increase its max capacity
  5. Note that the value reported by the stockpile switch does not change.
    ...

Expected Result

I would expect the stockpile switch to update relative to the level of items in the drawer, based upon it's max capacity.

Operating System

Windows Client, Ubuntu Server

Mod Version

0.5.0e

Minecraft Version

1.18.2

Forge Version

40.1.85

commented

any update on this?

commented

Thank you for looking into this issue! I'm incredibly grateful for that cd79de0

I'm not sure if I'm asking for more than is possible here, but I don't think the current behavior is expected behavior.

When using a stockpile switch with a specific item monitored, it uses the total storage space available, rather than the total space available in that given item slot.

For example, a 2x2 drawer has 4 inventory slots, with each holding up to 8 stacks.

  • Place gold in the first slot, with a single item filler placed in the remaining three.
  • Place a stockpile switch facing the drawer, and filter it to gold.
  • The result of the stockpile switch considers all 4 inventory slots to be valid for gold, though only the first inventory is.
  • As a result, what is expected to show 100% full in this example, will only show 25% full.

I'm not a Java dev so I can't be fully certain, but I think the answer to fixing this may be available in the drawer item handler class, here

Thank you for your work!

commented

The current behavior is certainly the most coherent with what the stockpile switch is supposed to do, but I do agree that storage drawers should be handled separately when provided with an item filter. However, this may be worth going through the suggestion process. I'd love to implement that myself if given the go-ahead. It's probably just a matter of modifying code around here.