Skip to content

Improve Menu Type example #800

Description

@TurboJax

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions