Storage Drawers

Storage Drawers

193M Downloads

Mekanism Logistical Sorter does not respect Storage Drawers Stack Downgrade

Paul-Moura opened this issue · 0 comments

commented

Affected Mods:

  • Storage Drawers (by Texelsaur / jaquadro)
  • Mekanism (by bradyaidanc)
  • Techopolis 3 (modpack integration issue)

🧪 Steps to Reproduce

  1. Place a Storage Drawer with a Stack Downgrade to limit the drawer to 1 stack.
  2. Insert a single item into the downgraded drawer and lock the drawer.
  3. Place a second drawer with an Iron Upgrade to hold 128 stacks.
  4. Fill the upgraded drawer with the same item and lock the drawer.
  5. Connect a Mekanism Logistical Sorter to the upgraded drawer:
  6. Set a filter to match the item.
  7. Set the destination color to red.
  8. Enable Size Mode.
  9. Set the Min/Max to 64.
  10. Connect Logistical Transport Pipes from the Logistical Sorter to the downgraded drawer.
  11. Color the connection red at the downgraded drawer

⚠️ Observed Behavior

When the downgraded drawer has less than 1 stack, the Logistical Sorter attempts to send 32 stacks, not 1.
The downgraded drawer accepts only the first stack.
The remaining 31 stacks are rejected and sent back, causing:

  • Pipeline congestion
  • Possible looped routing behavior
  • TPS or performance hits under high traffic

✅ Expected Behavior
The Logistical Sorter should respect the actual item capacity of the target inventory (in this case, 1 stack).
It should only send up to the remaining available amount (e.g., a partial stack or none if full).
This is critical when Storage Drawers are used as filters or gates.

📋 Additional Context
This interaction may be affected by how Mekanism queries inventory capabilities (IItemHandler or ISidedInventory).
Storage Drawers handle capacity constraints at the drawer logic level, not necessarily at the reported interface level — this may be why Mekanism sees the default 32 stack capacity instead of the downgraded limit.
Downgrades modify behavior server-side, not via metadata that other mods can always read correctly.

💡 Suggested Fix (Developer-side)
Either:
Storage Drawers should expose downgrade-altered capacity via standard inventory APIs
Or Mekanism should attempt to insert a test item before queuing bulk transfers, or limit transfer size to simulateInsert() results