DoubleDoorDevelopment / OversizedItemInStorageArea

TFC Container control for oversized items.
4 stars 0 forks source link

Item duplication glitch interaction with Backpacked #17

Open KittenRaee opened 4 years ago

KittenRaee commented 4 years ago

When oversize item is inserted into the backpack, it pops out as intended, but leaves item copied inside the backpack slot. Logs don't return any errors.

2020-10-23_02 52 40 2020-10-23_02 52 43 2020-10-23_02 52 48 2020-10-23_02 54 04

Claycorp commented 4 years ago

What backpack from what mod? There's a 99.99% I can't fix this without special casing it as I'm not seeing any item/block that holds the contents to modify at close time.

MrCrayfish commented 4 years ago

The backpack mod is mine. It's due to the inventory being saved before PlayerContainerEvent.Close is fired. This sounds like an issue that is not exclusive to my mod. This applies to any mod that has code in Container#onContainerClosed and does any logic with the inventory. Just a few examples but probably more.

All I could suggest is to inject a simple hook ServerPlayerEntity#closeContainer to run before Container#onContainerClosed to run your code. I forgot what the "ServerPlayerEntity" name equivalent is in 1.12.