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

Updating 1 item and changing the type of the list returned by InventoryManager#getOpenedPlayers #179

Open
Valxrie opened this issue Mar 9, 2021 · 0 comments

Comments

@Valxrie
Copy link

Valxrie commented Mar 9, 2021

Hi,

I thought it would be interesting having the feature for updating just 1 item in the inventory, without reloading the entire GUI.
This update doesn't remove the item's listener.

To do that I suggest this change in the method InventoryManager#getOpenedPlayers:

public List<UUID> getOpenedPlayers(SmartInventory inv) {
        List<UUID> list = new ArrayList<>();

        this.inventories.forEach((player, playerInv) -> {
            if (inv.equals(playerInv))
                list.add(player);
        });

        return list;
}

A list of players may cause problems inside InventoryContent's implementation (private method update), making the update impossible.

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

1 participant