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

hide_inventory: true/false #27

Open
kristophergeou opened this issue Dec 24, 2023 · 3 comments
Open

hide_inventory: true/false #27

kristophergeou opened this issue Dec 24, 2023 · 3 comments
Labels
enhancement New feature or request

Comments

@kristophergeou
Copy link

Basically hide_inventory: true/false if you want to hide a user's inventory (items) when they open a menu, so everything looks more nice and clear

@BlitzOffline
Copy link
Member

BlitzOffline commented Dec 24, 2023

We need some more clarifications on what exactly you're trying to achieve here.

I can think of 2 things you might be saying:

  • hide player inventory completely, including the texture: not possible
  • hide the items from the player inventory: possible but I don't think we want to do this. if we mess with player inventories we have to be damn sure they won't disappear. there are just too man edge cases to be considered and I personally don't want to see the day when someone comes complaining that their player's inventories have vanished. the reason I don't want to see it is that if the server doesn't have a rollback system in place, there's no way to recover.

@kristophergeou
Copy link
Author

yeah i was talking about the second option :/

@Starmism Starmism added the enhancement New feature or request label Dec 30, 2023
@Tanguygab
Copy link
Collaborator

Tanguygab commented Jan 2, 2024

hide the items from the player inventory: possible but I don't think we want to do this. if we mess with player inventories we have to be damn sure they won't disappear. there are just too man edge cases to be considered and I personally don't want to see the day when someone comes complaining that their player's inventories have vanished. the reason I don't want to see it is that if the server doesn't have a rollback system in place, there's no way to recover.

The "easiest" way which would avoid any issues would be, in my opinion, to send an inventory packet to the player to make it seem like his inventory is empty. And then, when the menu is closed, use Player#updateInventory() and Spigot will send back the player's inv as if nothing happened. That way, we don't need to store the player's inv nor fear any unfortunate accident with potential server crashes and stuff. We'd need to rely on NMS though

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

No branches or pull requests

4 participants