The example contains a Map<Player,InventoryView>, and even has a comment (shown below) explaining that using Player objects as keys and values is bad design, so could it just be changed to use player ids?
// A map to store all inventory views in. Generally it is not recommended
// to use Player objects as keys or values, but in this case it is acceptable
// because the inventory view is also bound to a player object, meaning we
// couldn't reuse it after a player rejoins anyways.
Also, could there be an example for listening to an InventoryClickEvent? It's not that necessary, since the same sort of logic is displayed in the PlayerQuitEvent handler. If it were to be added, it could prevent you from putting shulker boxes in your stash.
The example contains a
Map<Player,InventoryView>, and even has a comment (shown below) explaining that using Player objects as keys and values is bad design, so could it just be changed to use player ids?Also, could there be an example for listening to an InventoryClickEvent? It's not that necessary, since the same sort of logic is displayed in the PlayerQuitEvent handler. If it were to be added, it could prevent you from putting shulker boxes in your stash.