From a341731a753cf7022392e70039fd3f1c9b20ce59 Mon Sep 17 00:00:00 2001 From: LoJoSho Date: Sat, 14 Jan 2023 11:34:05 -0600 Subject: [PATCH] Added update checker --- build.gradle.kts | 5 +++++ common/build.gradle.kts | 1 + .../com/hibiscusmc/hmccosmetics/HMCCosmeticsPlugin.java | 8 ++++++++ 3 files changed, 14 insertions(+) diff --git a/build.gradle.kts b/build.gradle.kts index b660fcb7..026dc456 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -51,6 +51,9 @@ allprojects { artifact() } } + + // UpdateChecker + maven("https://hub.jeff-media.com/nexus/repository/jeff-media-public/") } dependencies { @@ -82,6 +85,7 @@ dependencies { implementation("dev.triumphteam:triumph-gui:3.1.3") implementation("org.spongepowered:configurate-yaml:4.1.2") implementation("org.bstats:bstats-bukkit:3.0.0") + implementation("com.jeff_media:SpigotUpdateChecker:3.0.0") } tasks { @@ -116,6 +120,7 @@ tasks { relocate("org.bstats", "com.hisbiscusmc.hmccosmetics.bstats") relocate("com.zaxxer.hikaricp", "com.hisbiscusmc.hmccosmetics.hikaricp") relocate("com.j256.ormlite", "com.hisbiscusmc.hmccosmetics.ormlite") + relocate("com.jeff_media.updatechecker", "com.hisbiscusmc.hmccosmetics.updatechecker") archiveFileName.set("HMCCosmeticsRemapped.jar") dependencies { diff --git a/common/build.gradle.kts b/common/build.gradle.kts index e0082420..9b592991 100644 --- a/common/build.gradle.kts +++ b/common/build.gradle.kts @@ -23,6 +23,7 @@ dependencies { implementation("dev.triumphteam:triumph-gui:3.1.3") implementation("org.spongepowered:configurate-yaml:4.1.2") implementation("org.bstats:bstats-bukkit:3.0.0") + implementation("com.jeff_media:SpigotUpdateChecker:3.0.0") } java { diff --git a/common/src/main/java/com/hibiscusmc/hmccosmetics/HMCCosmeticsPlugin.java b/common/src/main/java/com/hibiscusmc/hmccosmetics/HMCCosmeticsPlugin.java index ae8c189d..a3fb06f8 100644 --- a/common/src/main/java/com/hibiscusmc/hmccosmetics/HMCCosmeticsPlugin.java +++ b/common/src/main/java/com/hibiscusmc/hmccosmetics/HMCCosmeticsPlugin.java @@ -21,6 +21,8 @@ import com.hibiscusmc.hmccosmetics.listener.PlayerGameListener; import com.hibiscusmc.hmccosmetics.nms.NMSHandlers; import com.hibiscusmc.hmccosmetics.util.MessagesUtil; import com.hibiscusmc.hmccosmetics.util.TranslationUtil; +import com.jeff_media.updatechecker.UpdateCheckSource; +import com.jeff_media.updatechecker.UpdateChecker; import org.bstats.bukkit.Metrics; import org.bukkit.Bukkit; import org.bukkit.Location; @@ -58,6 +60,12 @@ public final class HMCCosmeticsPlugin extends JavaPlugin { return; } + // Update Checker + new UpdateChecker(this, UpdateCheckSource.POLYMART, "1879") + .setDownloadLink("https://polymart.org/resource/1879") + .checkEveryXHours(24) + .checkNow(); + // File setup if (!getDataFolder().exists()) { saveDefaultConfig();