Sophisticated Storage

Sophisticated Storage

36M Downloads

Easy duplication problem when using compression upgrade

OlickQC opened this issue ยท 3 comments

commented

Possible Fixes

Yes

Modpack Version

1.0.0

What happened?

qNQStDPjI1UN4Yxzk3Ppxw.mp4
  1. Create a Barrell with multiple slots
  2. Add a compression upgrade
  3. Attach a External Storage on the controller or drawer
  4. Place a ingot, like in my case Allthemodium
  5. Full your inventory with stuff to force the craft to go into the grid
  6. Craft while holding shift, item get duplicated

In Storage Drawers (not in the pack, but popular) and Functional Storage it's not working. Storage Drawers numbers just stay the same (like it should), same with Functional Storage.

https://www.youtube.com/watch?v=Y08uF59SBPQ

latest.log

No response

Developer reports

No response

commented

ATM Dev notes
Sophisticated versions in user stated modpack version of 1.0.0,

  • sophisticatedbackpacks-1.20.1-3.20.17.1150
  • sophisticatedcore-1.20.1-1.0.1.809
  • sophisticatedstorage-1.20.1-1.0.2.985

Also confirmed in latest versions of Sophisticated mods

  • sophisticatedbackpacks-1.20.1-3.22.1.1167
  • sophisticatedcore-1.20.1-1.1.2.834
  • sophisticatedstorage-1.20.1-1.1.4.1021

Issue confirmed to only occur with RS, and not AE2, Functional storage is also unaffected.

Sophisticated storage report #579
ATM9 report AllTheMods/ATM-9#2205

commented

Here's the related RS issue refinedmods/refinedstorage#3640

The issue is basically that RS doesn't check how many items it got returned when it extracts items from an inventory, just tells extract to extract amount and ignores the number it got returned.
And because Sophisticated Storage follows IItemHandler API definition which says that the maximum returned must be at most stack maxStackSize it will in this case return max 64 gold nuggets.

https://github.com/MinecraftForge/MinecraftForge/blob/f63813d92950390224f9eccaba9b675c10acad88/src/main/java/net/minecraftforge/items/IItemHandler.java#L67-L68

I could potentially change this to not follow the API definition but then if a mod actually relies on that in some way it could break something else (also I would hope that there is a reason that this note is included in API definition very likely because forge itself has some implementation that relies on this being the case)

The real fix is on RS side anyway - just extract multiple times when the amount to extract is more than maxStackSize.

Let me leave this open for a short bit, but I will likely just close.

commented

New release is out which makes it so that extractItem returns more than max stack size. Hopefully this doesn't break something else. Also this is only something I have done in 1.20 because of RS, in 1.21 it's still implemented correctly.