Dev:Register replaceable module - Ghost-chu/QuickShop-Reremake GitHub Wiki
Replaceable Module allow you replace QuickShop some part of code with yours.
Register
All works must done before QuickShop onEnable() called. So you must do like that:
- Add depend into plugin.yml make sure QuickShop loaded before your plugin loaded.
softdepend: [QuickShop]
- Impl the interface.
- Register your module into quickshop, quickshop use services manager so you need register yourself classes to services manager before quickshop booted up.
public void onLoad(){ //MUST ON ONLOAD METHOD
ItemMatcher mathcer = new YourSelfMatcher();
Bukkit.getServicesManager().register(mathcer, ItemMatcher.class, this, ServicePriority.NORMAL);
}
And we done, quickshop will use your module as expected.