If the product's license check fails, periodically broadcast a message

This commit is contained in:
Christian Koop 2023-06-09 15:19:28 +02:00
parent d0abbf26ec
commit 1e0de3d844
No known key found for this signature in database
GPG Key ID: 89A8181384E010A3

View File

@ -103,6 +103,12 @@ public abstract class SongodaPlugin extends JavaPlugin {
ChatColor.RED + "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~");
this.licensePreventedPluginLoad = true;
SongodaCore.registerPlugin(this, CraftaroProductVerification.getProductId(), (CompatibleMaterial) null);
getServer().getScheduler().scheduleSyncRepeatingTask(this, () -> {
String pluginName = getDescription().getName();
String pluginUrl = "https://craftaro.com/marketplace/product/" + CraftaroProductVerification.getProductId();
Bukkit.broadcastMessage(ChatColor.RED + pluginName + " has not been activated. Please download " + pluginName + " here: " + pluginUrl);
}, 5 * 20, 60 * 20);
return;
}