Stockpile switch math is off when slot sizes differ
MattiDragon opened this issue ยท 3 comments
Describe the Bug
The current implementation of the stockpile switch calculates the fill level of each slot individually and adds them up. This causes issues with inventories that have slots of differing sizes.
Reproduction Steps
- Install create and any mod that provides differently sized slots (for example, extended drawers (fabric)).
- For extended drawers, build a network with a two slot drawer and an access point
- Add an upgrade to one slot
- Connect a stockpile switch to the access point
- Play around with items and notice items if different slots have a different impact on the total
Expected Result
Create should calculate the total item count and capacity separately and then combine them.
Screenshots and Videos
No response
Crash Report or Log
No response
Operating System
Windows 11
Mod Version
0.5.1d
Minecraft Version
1.20.1
Forge Version
NA
Other Mods
No response
Additional Context
I have only tested this on the fabric version, but according to the code it's present on forge too and thus should be reported here.
The offending code is here.
I can confirm on Minecraft 1.20, Neoforge 47.1.96, Create 0.5.1.f and Sophisticated Storage (at least, as I've got this one on hand) 0.8.65.680 & Sophisticated Core 0.5.113.524.
Edit: To confirm the problem exists only for the stack size for SoSt upgrading the size doesn't change the storage seen by the TSwitch, but upgrading the storage tier does work.