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

GuiStorageElement setStoreAction #23

Open
weihao opened this issue Jan 17, 2021 · 3 comments
Open

GuiStorageElement setStoreAction #23

weihao opened this issue Jan 17, 2021 · 3 comments

Comments

@weihao
Copy link

weihao commented Jan 17, 2021

When interacted with gui storage element, we should be able to handle the event

@Phoenix616
Copy link
Owner

What exactly is your use case? Because there is already a GuiStorageElement#setApplyStorage(Runnable) with which you can define what should happen whenever an item was changed. Theoretically one could also back the element with a custom Inventory class to get even more information about what is changed.

@weihao
Copy link
Author

weihao commented Jan 17, 2021

How does the runnable have the contexts when an item was changed? Could you share an example?

@Phoenix616
Copy link
Owner

Phoenix616 commented Jan 17, 2021

Currently there is no context, it's meant to be used to save the whole inventory. I guess it could be possible to expose some more information about which item changed there in that but that should already be possible by simply using a custom class which implements Bukkit's Inventory

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

No branches or pull requests

2 participants