Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Item duplication glitch interaction with Backpacked #17

Open
KittenRaee opened this issue Oct 23, 2020 · 2 comments
Open

Item duplication glitch interaction with Backpacked #17

KittenRaee opened this issue Oct 23, 2020 · 2 comments

Comments

@KittenRaee
Copy link

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
Copy link
Member

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
Copy link

MrCrayfish commented Oct 23, 2020

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants