Roots

Roots

24M Downloads

Pouch dupe

SpoilersMC opened this issue ยท 5 comments

commented

Description:
This is an old old dupe that used to plague mods in 1.7.10, basically you drop a container and open it at the same time.

Reproduction:

  1. Hold pouch(apothecary or component) in main hand
  2. press the hotkey for opening the pouch/right click and then immediately press q, more or less pressing both at the same time but opening the pouch before dropping it, might take a few tries
  3. pouch gui appears on screen and items can be removed from it, pouch item drops on the ground
  4. remove items, close gui, pick up dropped pouch, remove items a second time

Expected behavior:
many mods for 1.7.10 used to have this dupe and a few in 1.12 do as well, probably requires running additional checks for item location and/or storing the inventory to an external location not connected directly to the item, im not an expert on what needs to be done to resolve this, those are just some things other mod devs have done.

Mystic Mods Versions

  • Roots: 3.0.25
  • MysticalLib: 1.6.0

Other Versions:

  • Forge: 14.23.5.2847
  • Minecraft: 1.12.2

Screenshot (gif):

rootsdupe

commented

Bonus: while testing this dupe i discovered that you can move opened pouches around your inventory using the number keys, if you open a pouch on your hotbar, and then hover over a slot in the pouch and press the number corresponding to the hotbar location of the pouch, the pouch will get put inside itself, crash the player, and delete itself on relog
if you put a different pouch into the currently open pouch, theres no way to remove it.

commented

Thanks for the information!

Especially the bonus point, that one is frustrating as hell and I keep forgetting that is a possibility. I think I can bypass that by making an isSlotValid function that checks to make sure that the item isn't another pouch, meaning you can't move items in regardless - in theory, if Minecraft actually checks that.

For the former, that is literally what I'm currently coding: the inventory will be stored safely in the "world save data" (server-side data cache in the data folder), and instead pouches will have a UUID associated with them which is then used when looking up the inventory.

Hopefully that'll address the former issue!

If you're interested, I've just started a wide, open alpha of Roots 3.1 on the Mystic Modding Discord -- it will have compatibility issues with a lot of things, including pre-existing pouches, but if you're interested in checking it out I'd love the same level of diligence and feedback that you've shown with this issue!

commented

Thanks for the quick response and feedback! And good luck with getting that working, I'll definitely make sure to hop on the discord server and check out that alpha when I have time between reporting on githubs all of the other annoyances the kids on the server I staff keep finding. xD

commented

Also, what's the mod letting you see a WAILA like screen for a dropped item?

commented

I think I've finally come up with a bug-free solution to the pouches; it won't hold over upgrades at the minute (pouches would just be wiped) as I have yet to code some transitionary stuff, but all pouches are now stored externally on the server and hopefully with no additional overheads as saving the world data is only called once (on the container closing).

(And the world data should be saved regularly enough regardless)