MinusKube / SmartInvs

Advanced Inventory API for your Minecraft Bukkit plugins.
https://minuskube.gitbook.io/smartinvs/
Apache License 2.0
263 stars 65 forks source link

Observer design pattern for the providers. #129

Closed portlek closed 4 years ago

portlek commented 4 years ago

I think update method in the provider is not useful when you want to update the inventory for certain situations. We should add observer design pattern for the provider.

The pattern is working like when somebody use update method in SmartInventory, notify method in InventoryProvider will run. It will run the update method when it used, not like the old update method(it's working in a scheduler).

update(ImNotSureAboutTheseParameters) method should be added to SmartInventory and notify(Player, InventoryContest) method should be added to InventoryProvider.