-
-
Notifications
You must be signed in to change notification settings - Fork 4
Update Checker
The Update checker is a plug and play update checker for your plugin.
To check if a update is available call the static method performAndNotifyUpdateCheck()`
UpdateChecker.performAndNotifyUpdateCheck(pluginInstance, 80805);
The numbers should be your plugin id. You can find it at the end of your resources link on spigot.
https://www.spigotmc.org/resources/big-doors-opener.80805/
In this case its 80805.
And that's all. If a update is available the user will get a message in the console at startup or whenever you call this method. Sitenote: You should set the resource page at your website at the plugin.yml. This link will be printed in the console to update.
Of course that's not all.
You can also start a listener to notify operators or players with a specific permission about this update.
To do this pass a permission to the method.
UpdateChecker.performAndNotifyUpdateCheck(pluginInstance, 80805, "admin.permission");
If you don't want to define a permission you can just set this to true. We will then use the plugin name as a permission. This will most likely only match if the user has a '*' permission.
UpdateChecker.performAndNotifyUpdateCheck(pluginInstance, 80805, true);