jaquadro / StorageDrawers

A mod adding compartmental storage for Minecraft Forge
MIT License
203 stars 160 forks source link

Drawer upgrade overwrite glitch when trying to limit stacks that are already in excess #1088

Closed Jack-McKalling closed 1 year ago

Jack-McKalling commented 1 year ago

When you try to replace a drawer upgrade (such as the emerald one) with a flint upgrade, while the drawer is already over a stack full, the flint upgrade gets deleted and turns into a duplicate emerald one.

How to reproduce:

  1. Place a 1x1 drawer
  2. Insert 128x stone (two stacks)
  3. Insert an emerald upgrade
  4. Open the drawer GUI
  5. Pick up a flint upgrade and try to click it on the emerald upgrade ❌ flint upgrade literally turned green

This doesn't happen if the stack limit implied by the flint upgrade hasn't been reached yet when doing this (e.g. with only 64x stone)

Expected behaviour: When you attempt to exchange an upgrade for another upgrade, by clicking with an item in your cursor on an item in the GUI, and when that exchange would result in the drawer having an overflow of contents (illegal state as mandated by the upgrades), then that exchange should be refused altogether. Nothing should happen and the items in the GUI and in your cursor should remain unchanged. Exactly like what happens if you directly try to take out an upgrade that is required for the drawer to hold all of its current contents.

Versions: Forge: 43.2.14 SD: 1.19-11.1.2

This issue exists in 1.16.5 too.

IntegerLimit commented 1 year ago

Can we close this?

Jack-McKalling commented 1 year ago

Yes, this has now been fixed in latest version. Although it would be nice to have this fix in 1.16.x, 1.18.x and 1.19.x too.