Jump to content

Item Duplication and Nested Bags [MC 1.4.6 | Forge 6.5.0.474]


Recommended Posts

Posted

I will preface this by saying that this may not be directly a Forge issue. I honestly can't find any good way to determine that. HOWEVER it happens across multiple mods, with the only common points being Minecraft and Forge. Therefore, it seems far more useful to report this here than on each mod support area. Most likely the best solution(s) will be on Forge's side of things, rather than a per-mod basis. I'll go in to that after detailing the problem, however.

Additionally, this might be better as two separate issues, however, the two issues tie in together in a rather unpleasant fashion.

 

---

Item Duplication:

 

Item duplication is depressingly easy and reliable, once you understand how to do it. Follow these steps:

1. Get any portable storage item with a custom interface (IC2 Cropnalyzer, Forestry Letter, etc (and again, NOT mod specific!)).

2. Get an item to duplicate (I tested with diamond blocks, because hey why not).

3. Open the storage item's interface.

4. Place the item to be duplicated in one of the storage item's interface slots.

5. Close the inventory item's interface.

6. Open the inventory item's interface again.

7. Select the item to be duplicated and WITHOUT PLACING IT DOWN ANYWHERE close Minecraft.

8. Relaunch Minecraft and when you get back into the world or server, you'll see whatever item you were working with in front of you. Pick it up. Open the storage item you were duplicating with. There will be another copy of the item in there.

 

Now, what seems to be happening is that the custom interface expects to be closed to save its correct state. Minecraft, meanwhile, tracks things with a bit more detail. So, you end up with both item instances being remembered, with (presumably) no checking between Minecraft and the storage item. This causes both to exist when you get back into the game.

This by itself would be merely an annoyance (though still one worth fixing) that not many would bother with for long; Honestly, it's kind of a pain to do this with any regularity, since modded Minecraft takes a while to launch. This leads into why Nested Bags is included in this same bug report.

 

---

Nested Bags:

 

Nesting bags is even easier than item duplication. You just take two portable storage items and put one inside the other. There seems to be no checking whatsoever to see if this should or shouldn't be allowed (and it really shouldn't, that's just silly). By itself this is just a rather silly way to expand the inventory exponentially (a rather nasty bug in itself, but probably not something most would bother with, due to the increased human memory costs and number of clicks it creates). But when combined with the Item Duplication bug above, you can then start to duplicate (for example) letters that are full of Diamond Block stacks and Quantum Armor. Suddenly Item Duplication is not just reliable and fairly easy, but also the time and hassle of restarting Minecraft is greatly mitigated by the sheer quantity of items you can duplicate at once.

Proposed solution, from one of the people in the community I run my server for:

There should be a global flag to designate when something is a portable storage item, which blocks those items from being placed inside of any other item with the same flag.

 

---

 

Even when you combine the two bugs to spawn bags or letters or whatever just overflowing with rare and valuable gear, it doesn't even come close to the additional bug I discovered while testing.

 

---

Infinite Item Duplication via Nested Bags:

 

This is where things get really nasty. I decided I would test out what happens when you duplicate nested storage items. Nesting to the first level did nothing special. Nesting to the second level...that's where things get interesting.

The setup:

I took a letter (again, this is not mod dependent, Forestry just has the items with the most freedom as far as what is allowed in and are thus easiest to test with) and placed two stacks of diamond blocks in it. I then placed this letter inside of a canvas bag. I then placed that canvas bag inside of another letter.

A quick diagram, topmost layer is the 'outer' layer, bottom is the 'inner':

 

Letter

Canvas Bag

Letter

2x64 Diamond Block

 

I opened and closed the 'outer' most item (Letter) in order to save its state, then selected the canvas bag inside of it and closed out of Minecraft. When I reopened Minecraft, as expected, there was a Canvas Bag on the ground in front of me. I picked that item up, then checked the letter. Inside of it, as expected, another Canvas Bag. I then opened each Bag in turn, and pulled out the inner Letter. Both letter duplicates had their 2x64 Diamond Block stacks. I pulled the Blocks out of first one, then the other. But when I closed the letter again, I noticed that it was 'large' as if it had stuff in it still. So I opened it again. 2 more Block stacks. This is repeatable infinitely.

Now, I tested further with a Cropnalyzer from IC2. It did NOT cause this infinite cycle. It did still duplicate, though. So possibly that particular subset of this issue is Forestry-specific. However, it would be remedied by fixing the Nested Bags with a flag as suggested above.

 

---

 

As stated previously: I KNOW that this is not necessarily a Forge specific bug. I KNOW that these are showing up in mods. HOWEVER it seems that the most useful way to fix this is to do it in Forge, since that's the common value here, and most likely the mods are using Forge functions for their custom storage methods. Please do not discard this on a technicality like that, this needs to be fixed. I will provide further details and information as requested, and will even provide access to my testing server so that this can be examined fully and resolved properly.

 

To reiterate, so that the suggested fixes aren't lost in the morass above:

Item Duplication: it seems like the issue is that the custom storage handling is waiting for the interface to be closed before updating its state, whereas Minecraft tracks it with greater detail, making it possible (even easy) to trick both into thinking the item exists. Could fix this by making the storage methods update with greater detail. This could increase lag, however. I have no other suggestion.

 

Nested Bags: There should be a global flag to designate when something is a portable storage item, which blocks those items from being placed inside of any other item with the same flag.

 

Infinite Item Duplication via Nested Bags: Fixing the first two will fix this. It's included purely to show how incredibly bad the bugs are.

 

---

 

Here are my logs, both server and client:

 

Client:

 

  Reveal hidden contents

 

 

Server:

 

  Reveal hidden contents

 

Posted

Simple, mods need to be aware that a users actions in a inventroy can cease at anytime. And they should not require the clean closure to function properly.

I do Forge for free, however the servers to run it arn't free, so anything is appreciated.
Consider supporting the team on Patreon

Posted

For note, RP2's bags do this properly as it will kill itself if anything odd is detected.

And also for note, the vanilla workbench had a dupe bug too that is similar to what you said, and no I will not tell you how to do it.

Guest
This topic is now closed to further replies.

Announcements



×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.