-
Notifications
You must be signed in to change notification settings - Fork 74
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
Make picked item stack not drop when clicking Curios inventory button #32
Comments
I haven't even thought about that before, but that would be really quite useful. Hope @TheIllusiveC4 will implement this feature. |
Spent some time trying to figure out a way to get this to work. Unfortunately, Minecraft really doesn't want players to carry over stacks to different GUIs. I tried some workarounds but none of them worked right, so this probably won't be implemented. |
It's definitely trickier than I expected. I managed to create a working workaround, however it seems very hacky. There's definitely room for improvement. It basically saves the held item stack in a variable both on the server and the client before it changes the GUI, sets the held stack to empty (such that the inventory doesn't drop the item when closed) and then restores the object both client- and server-side after the new GUI has been opened. However, client-side this can't be done in the constructor, because it has to be done after Server side it's done before and after the NetworkHooks are called in the packet classes sent from the client to the server. Here's a link to the branch of my work where I implemented this, if you're interested: Affected classes: |
Alright, I took a slightly different approach but I've got it working. There's just a slight visual flicker when moving from the Curios GUI to the vanilla GUI that I'd like to see if I can fix first. |
Please describe the new feature or change.
The picked item stack should not drop out of the inventory when clicking the button to open the Curios inventory screen.
Please describe why you want this feature.
Occasionally, players might want to equip a Curio and then realize that the Curios inventory wasn't open, which leads to them trying to click the button to open that screen. It works, but simultaneously, the item stack will be dropped.
The text was updated successfully, but these errors were encountered: