InventoryGui icon indicating copy to clipboard operation
InventoryGui copied to clipboard

GuiStorageElement setStoreAction

Open weihao opened this issue 4 years ago • 3 comments

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

weihao avatar Jan 17 '21 01:01 weihao

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.

Phoenix616 avatar Jan 17 '21 14:01 Phoenix616

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

weihao avatar Jan 17 '21 19:01 weihao

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

Phoenix616 avatar Jan 17 '21 19:01 Phoenix616