Refined Storage

Refined Storage

77M Downloads

Refined Storage Dupe

TrioGG opened this issue · 4 comments

commented

Issue description:Item Duping

What happens:

Have Mystical Agriculture Essences stored in Quantum Storage Unit from QuantumStorage. If I cancel an autocrafting process involving items that are in the Quantum Storage Units the amount of essence in them jumps anywhere from 20k to a million.

What you expected to happen: On canceling the process the items that are stored are returned to the QSU.

Steps to reproduce: 1: Connect an External Storage Bus to a QSU

2: Make sure the External Bus is the highest priority on the network.

3: Begin an auto crafting process. (Doesn’t matter if it’s many of a single item or a multi step craft. For me it worked when crafting tons of gold bars using essence from Mystical Agriculture as well as crafting the max Storage Drive from RebornStorage.)

4: Cancel the autocrafting process in the Crafting Monitor.

Version (make sure you are on the latest version before reporting):

  • Minecraft: 1.12.
    Latest Stoneblock

Does this issue occur on a server? [yes/no] haven’t tried on a server

If a (crash)log is relevant for this issue, link it here:

[pastebin/gist/etc link here]

commented

I am experiencing crafting item duplication with YABBA barrels at the start of the crafting process. The duplicated items are returned into the barrels at the end.

The item duplication occurs in CraftingTask.extractInitial:
https://github.com/raoulvdberge/refinedstorage/blob/mc1.12/src/main/java/com/raoulvdberge/refinedstorage/apiimpl/autocrafting/task/CraftingTask.java#L554

internalStorage is credited with toExtract.getCount() items instead of result.getCount() items. YABBA barrels will return a max of getMaxStackSize() items at a time, less than toExtract.getCount() for large crafting requests.
Note that extractInitial runs several times to fulfill large crafting requests from barrels, pulling a stack at a time.

The same duplication bug exists for fluids below at line 576.

Proposed fix:

src/main/java/com/raoulvdberge/refinedstorage/apiimpl/autocrafting/task/CraftingTask.java
Line 554
-                     internalStorage.insert(toExtract, toExtract.getCount(), Action.PERFORM);
+                     internalStorage.insert(toExtract, result.getCount(), Action.PERFORM);

Line 576
-                     internalFluidStorage.insert(toExtract, toExtract.amount, Action.PERFORM);
+                     internalFluidStorage.insert(toExtract, result.amount, Action.PERFORM);
commented

This bug also allows for silly things like:

  1. Attaching 3 External Storages to the same chest, containing 3 gold ingots. The RS network thinks it has 9 gold ingots but only 3 may be extracted from a grid.
  2. Autocrafting a single gold block from the 3 gold ingots.
commented

When using any auto-crafting recipe that pulls items from an external storage connection to a Quantum storage unit( and possibly other external storage)

I hooked up several quantum storage units to the RS build I had and queued to create 10 quadruple compressed redstone blocks.

When reviewing the request in the crafting monitor, it showed over 58 Million redstone being listed as stored. When it would only take approx 590,000 redstone to craft... not sure why it's duplicating it 100x, but this bug crashed our server.

I also noticed that it did something similar to cobblestone that I told to make into sand, when it completed the 30,000 sand creation, it jumped from 250k cobblestone to over 3 million cobblestone, I didn't realize this until after I saw the compression on the redstone.

I also noticed that whether I canceled the operation or let it complete, it still created the duplicate items.

I am not a server admin on this server and do not have access to the crash report, but I know that's what caused the crash as no-one else was on the server at the time, and 58 million redstone would have completely overwhelmed the RS build that I had setup.

commented

same issue, using voltz m1.12, tried to make a bit of extra storage, canceled, then suddenly went from about 15k sand to about 100k sand, again and i hit like 4 mill. now i did it again on accident and im at 16M sand, mostly in a 16M reborn storage drive, which is a refined storage addon that adds 4 more higher tiers of drives and the giant crafter from ae1