Create Fabric

Create Fabric

7M Downloads

Threshold Switch cannot detect items from the item vault

feipangjun opened this issue ยท 3 comments

commented

Describe the Bug

Threshold Switch cannot detect items from the item vault
I noticed that the Threshold Switch can work properly on build.1376, but when i update to build.1394. The problem floated out. And it still exist on build.1408

Reproduction Steps

1.install the build.1394 or higher
2.place the item vault and put some item in it
3.place a Threshold Switch and use it to detect items

Expected Result

Screenshots and Videos

2024-04-07_21 54 25
2024-04-07_21 57 49

Crash Report or Log

No response

Operating System

Windows 11

Mod Version

0.5.1f

Minecraft Version

1.20.1

Other Mods

Fabric loader 0.15.7
Fabric API 0.92

Additional Context

No response

commented

Hello @TropheusJ, I think this fix broke compatibility with Extended Drawers mod, MattiDragon/ExtendedDrawers#102. Current behavior is that Threshold Switch thinks that the maximum amount of items in slot is 64, while drawers allow to store multiple stacks and they do it in one slot.

Replacing long space = Math.min(stackInSlot.getMaxStackSize(), view.getCapacity()); with long space = view.getCapacity(); may help to solve this. Not sure if it will affect vaults or not.

I'll try to patch this, test with Extended Drawers and let you know the results

commented

Just checked, replacing long space = Math.min(stackInSlot.getMaxStackSize(), view.getCapacity()); with long space = view.getCapacity(); fixes the issue with Extended Drawers.

commented

Tested it as well and it doesn't seem to break item vaults. This also is in line with c8685f3. Would close both this issue and #1459