P3pp3rF1y / SophisticatedCore

GNU General Public License v3.0
9 stars 30 forks source link

Quick move causes items to disappear #257

Closed jcrAron closed 1 month ago

jcrAron commented 1 month ago

version

1.20.x

what happened?

  1. install the mod https://www.curseforge.com/minecraft/mc-mods/one-stack to change max count of itemstacks
  2. Open barrel (or chest) GUI
  3. Place an item with a count of 2,147,483,648 into the chest
  4. Quick move another item to the chest
  5. the items disappears both

When the itemstack count is large, such as 2,147,483,648, margining to another itemstack will cause integer overflow.

I think...

change https://github.com/P3pp3rF1y/SophisticatedCore/blob/ceff5106cb4be4df45c3bde4f565d8c7180e81c6/src/main/java/net/p3pp3rf1y/sophisticatedcore/common/gui/StorageContainerMenuBase.java#L1237 to

if (j <= maxSize && j > 0)
P3pp3rF1y commented 1 month ago

I am sure there would be a ton of other issues with that mod as it must be overriding other stuff in multiple places so you can just consider that incompatibility and you need to decide whether you want to play with backpacks/storage or that mod. Sophisticated also has stack upgrades to raise stack counts.